rsnext/examples/with-dynamic-import
Luis Alvarez D b5cf3e4c94
Update dynamic-import docs (#16803)
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
2020-09-05 23:45:30 +00:00
..
components Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
pages Update dynamic-import docs (#16803) 2020-09-05 23:45:30 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
package.json Update dynamic-import docs (#16803) 2020-09-05 23:45:30 +00:00
README.md Simplify example usage instructions (#16678) 2020-08-29 22:22:02 -04:00

Example app with dynamic-imports

This examples shows how to dynamically import modules via import() API

Deploy your own

Deploy the example using Vercel:

Deploy with 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).