Q31. How do you handle environment variables in Next.js?
Next.js has built-in support for environment variables managed through `.env` files with strict client/server boundary isolation: ### File Priority Hierarchy: 1. `.env.de...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (188 available).
Next.js has built-in support for environment variables managed through `.env` files with strict client/server boundary isolation: ### File Priority Hierarchy: 1. `.env.de...
By default, Next.js runs on **port 3000** for both the development server (`next dev`) and production server (`next start`). When you launch `npm run dev`, you can access...
You can change the port used by Next.js using several straightforward approaches: ### 1. In `package.json` Scripts (Recommended): Pass the `-p` (or `--port`) flag in your...
**Fast Refresh** is Next.js's hot module replacement (HMR) experience that provides near-instantaneous visual feedback when you edit React components in development. ### ...
A configuration file to customize Next.js settings. ```ts // @ts-check /** @type {import('next').NextConfig} */ const nextConfig = { /* config options here */ }; module.e...
Using CSS modules with a `.module.css` file extension. ``` // styles.module.css .example { color: red; font-size:18px; } // Component.js import styles from './styles.modu...
Adding global CSS depends on whether you are using the modern **App Router** or the legacy **Pages Router**: ### 1. In App Router (`app/` directory): Import your global C...
By installing Tailwind CSS and configuring it in the next.config.js file. ```bash npm install tailwindcss postcss autoprefixer npx tailwindcss init -p ``` Then, add the f...
Rendering pages on each request. If a page uses Server-side Rendering, the page HTML is generated on each request. ```jsx export async function getServerSideProps() { con...
Pre-rendering pages at build time. If a page uses Static Generation, the page HTML is generated at build time. ```jsx export async function getStaticProps() { const res =...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.