mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
19 lines
364 B
JavaScript
19 lines
364 B
JavaScript
import { lazy, Suspense } from 'react'
|
|
import dynamic from 'next/dynamic'
|
|
|
|
const Foo = lazy(() => import('../components/foo'))
|
|
const Bar = dynamic(() => import('../components/bar'), {
|
|
suspense: true,
|
|
})
|
|
|
|
export default function Page() {
|
|
return (
|
|
<div>
|
|
<Suspense fallback="fallback">
|
|
<Foo />
|
|
<Bar />
|
|
</Suspense>
|
|
</div>
|
|
)
|
|
}
|