Next.js Quiz Next js Quiz 1 / 20 What is Next.js? A JavaScript library for building user interfaces. A backend framework for Node.js. A framework for building server-side rendered React applications. A CSS preprocessor. 2 / 20 Which company developed Next.js? Facebook Google Microsoft Vercel 3 / 20 What is the default port for a Next.js development server? 8000 3000 5000 8080 4 / 20 How do you create a new Next.js project? npm create-next-app my-app create-next my-app npx create-next-app my-app next new my-app 5 / 20 What file is used to configure routes in a Next.js application? routes.js app.js pages/index.js There is no routing file; it uses file-based routing. 6 / 20 How can you create a dynamic route in Next.js? By using curly braces in the file name, e.g., 'pages/post/{id}.js.' By using square brackets in the file name, e.g., 'pages/post/[id].js'. By creating a route configuration file. By using angle brackets in the file name, e.g., 'pages/post/.js'. 7 / 20 What function is used to fetch data at build time in a Next.js static generation page? getInitialProps getServerSideProps getStaticProps getData 8 / 20 What function is used to generate static paths for dynamic routes? getPaths getStaticPaths getDynamicPaths getServerPaths 9 / 20 What function is used to fetch data at request time in a Next.js server-side rendering page? getInitialProps getServerSideProps getStaticProps getRequestProps 10 / 20 How can you enable API routes in a Next.js application? By creating files inside the 'api' directory. By creating files inside the 'pages/api' directory. By configuring routes in 'next.config.js'. By installing an API routes plugin. 11 / 20 Which hook is provided by Next.js to optimize images? useImage usePicture next/image Image 12 / 20 How do you navigate programmatically in a Next.js application? 'useRouter' from 'react-router-dom' 'useNavigation' from 'next/navigation' 'useRouter' from 'next/router' 'useNavigate' from 'next/navigate' 13 / 20 What command is used to build a Next.js application for production? next dev next build next start next export 14 / 20 What is the purpose of next.config.js? To configure server routes. To extend and customize the configuration of a Next.js project. To configure database connections. To set environment variables. 15 / 20 Which feature allows you to pre-render pages at build time and update them incrementally? Static Generation Server-Side Rendering Client-Side Rendering Incremental Static Regeneration 16 / 20 How can you add global CSS styles to a Next.js application? By importing the CSS file in 'pages/_app.js'. By importing the CSS file in 'pages/index.js' By creating a 'styles/global.css' file. By adding a 'global.css' file to the 'public' directory. 17 / 20 What is the role of pages/_document.js in a Next.js application? To customize the HTML document structure. To configure server-side data fetching. To define global styles. To manage API routes. 18 / 20 How can you handle redirects in Next.js? By using the 'next/router' library. By adding a 'redirects' function in 'next.config.js'. By creating a '_redirects' file in the 'public' directory. By configuring redirects in 'pages/_app.js'. 19 / 20 What is the purpose of Link component in Next.js? To create external links. To enable client-side navigation between routes. To link CSS files. To handle API requests. 20 / 20 How do you perform static export in Next.js? By running 'next export' after 'next build'. By running 'next dev'. By configuring 'export' in 'next.config.js'. By using the 'staticExport' command. Your score isThe average score is 0% 0% Restart quiz