b5cf3e4c94
Goals of this PR: - Explain `import()` first without mentioning `next/dynamic`, because `next/dynamic` in our API and **Dynamic Import** is a ES feature. This should avoid a common confusion in our users thinking that one can't be used without the other. - Mention how `next/dynamic` can be used with **Dynamic Imports** to load react components. - Updated example to include fuzzy search using a dynamic import. Potential change: Leave the page to be about `import()` and move `next/dynamic` to the API reference (alongside `next/link`, `next/router`, etc.) Closes https://github.com/vercel/next.js/pull/16299 Closes https://github.com/vercel/next.js/issues/15711 |
||
---|---|---|
.. | ||
components | ||
pages | ||
.gitignore | ||
package.json | ||
README.md |
Example app with dynamic-imports
This examples shows how to dynamically import modules via import()
API
Deploy your own
Deploy the example using Vercel:
How to use
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example with-dynamic-import with-dynamic-import-app
# or
yarn create next-app --example with-dynamic-import with-dynamic-import-app
Deploy it to the cloud with Vercel (Documentation).