mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 16:07:01 +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 USPSection from '@/components/modules/usp-section/usp-section';
|
||||||
|
|
||||||
import { InformationCircleIcon } from '@heroicons/react/24/outline';
|
import { InformationCircleIcon } from '@heroicons/react/24/outline';
|
||||||
|
import { Suspense } from 'react';
|
||||||
interface getContentComponentProps {
|
interface getContentComponentProps {
|
||||||
_type: string;
|
_type: string;
|
||||||
_key: number;
|
_key: number;
|
||||||
@ -87,7 +88,9 @@ interface dynamicContentManagerProps {
|
|||||||
|
|
||||||
const DynamicContentManager = ({ content }: dynamicContentManagerProps) => {
|
const DynamicContentManager = ({ content }: dynamicContentManagerProps) => {
|
||||||
return (
|
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