React & Modern Frontend (445 Qs)•Part 8: Advanced React Patterns, Portals & Performance (152 - 261)
What is NextJS and major features of it?
Next.js is a popular and lightweight framework for static and server‑rendered applications built with React. It also provides styling and routing solutions. Below are the major features provided by NextJS,
- Server-rendered by default
- Automatic code splitting for faster page loads
- Simple client-side routing (page based)
- Webpack-based dev environment which supports (HMR)
- Able to implement with Express or any other Node.js HTTP server
- Customizable with your own Babel and Webpack configurations
Practical Code Example
javascript
// Next.js: Full-stack React framework featuring:
// 1. App Router with React Server Components (RSC)
// 2. Hybrid rendering (SSR, SSG, ISR)
// 3. API Route Handlers
// 4. Built-in Image, Font, and Script optimization