Skip to main content

Dynamic imports

Dynamic imports

Preloading and prefetching

Since we're using webpack, to built the application, it already has support for inline directives for preloading and prefetching. Using this comment:

import(/* webpackPrefetch: true */ './path/to/LoginModal.js');

will result in<link rel="prefetch" href="login-modal-chunk.js"> being appended in the head of the page. For more information about

React suspense

Suspense currently doesn't support SSR. However you can use it to load client-side react components. Don't forget to add proper handlers so it only gets rendered on client, since SSR will result in an hydratation error.