dynamic-fallback.js 719 B

1234567891011121314151617
  1. /**
  2. * `loading` for registry entries loaded with `next/dynamic`:
  3. *
  4. * dynamic(() => import('./text'), { loading: DynamicFallback })
  5. *
  6. * Any `loading` gives each entry its own Suspense boundary. Without one, a
  7. * component that is not loaded yet (a form opened by a click) suspends up to the
  8. * page boundary and blanks the whole page; with one, only that spot waits, and
  9. * server-rendered entries hydrate independently.
  10. *
  11. * Keep the call literal — `dynamic(() => import('…'), { … })` with `dynamic`
  12. * imported from 'next/dynamic' — so Next can preload the chunks of every entry
  13. * rendered during SSR (a wrapper around `dynamic` loses that).
  14. */
  15. export function DynamicFallback() {
  16. return null;
  17. }