mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 07:56:59 +00:00
Test to add suspense to dynamic content
This commit is contained in:
parent
f2c7f184f2
commit
8849edfc8a
@ -6,6 +6,7 @@ import Slider from '@/components/modules/slider/slider';
|
||||
import USPSection from '@/components/modules/usp-section/usp-section';
|
||||
|
||||
import { InformationCircleIcon } from '@heroicons/react/24/outline';
|
||||
import { Suspense } from 'react';
|
||||
interface getContentComponentProps {
|
||||
_type: string;
|
||||
_key: number;
|
||||
@ -87,7 +88,9 @@ interface dynamicContentManagerProps {
|
||||
|
||||
const DynamicContentManager = ({ content }: dynamicContentManagerProps) => {
|
||||
return (
|
||||
<div className="dynamic-content overflow-x-hidden">{content?.map(getContentComponent)}</div>
|
||||
<div className="dynamic-content overflow-x-hidden">
|
||||
<Suspense fallback={<div>Loading...</div>}>{content?.map(getContentComponent)}</Suspense>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user