Next.js
- NextJS includes its own routing library so we do not need to install routing specific libraries like react-router that we do when working with reactjs
- We use a mixture of CSR and SSR
- Next JS framework components
- In nextjs, the router is based on the file system
- Routing in next.js is based on convention and not configuration
- Unlike how we do it in react (react-router), we do not have to configure and map routes to components
- We can simply create files and folders to represent our routes
- Folders aren't publicly accessible unless we add a page file in it
- Use <Link> instead of <a>
- 'use client'; is used to tell the compiler that that file is meant for CSR and must be included in JS bundle
- Rendering in Next.js
- By default, next.js caches the api calls and renders the routes at build time
- For dynamic rendering:
Comments
Post a Comment