The Wayback Machine - https://web.archive.org/web/20260119143304/https://www.geeksforgeeks.org/quizzes/function-in-nextjs/

Function in Next.js

Last Updated :
Discuss
Comments

Question 1

Which method is used in Pages Router for server-side rendering?

  • getStaticProps

  • generateMetadata

  • getStaticPaths

  • getServerSideProps

Question 2

Which method is required when using getStaticProps with dynamic routes?

  • getServerSideProps

  • NextRequest

  • getStaticPaths

  • generateStaticParams

Question 3

In App Router, which function replaces _document.js metadata handling?

  • generateMetadata

  • getStaticPaths

  • generateStaticParams

  • getServerSideProps

Question 4

Which function allows creating Open Graph and Twitter card metadata for images?

  • generateImageMetadata

  • NextResponse

  • generateMetadata

  • generateImageMetadata

Question 5

What is the recommended way to fetch data in Next.js App Router?

  • getStaticProps

  • axios.get()

  • fetch()

  • getServerSideProps

Question 6

Which function in App Router is equivalent to getStaticPaths from Pages Router?

  • getStaticProps

  • generateStaticParams

  • generateMetadata

  • getServerSideProps

Question 7

What is the purpose of NextResponse in Next.js middleware?

  • Handle database queries

  • Fetch API data

  • Generate static props

  • Return custom responses

Question 8

Which object gives you access to headers, cookies, and URL inside middleware?

  • NextRequest

  • generateMetadata

  • NextResponse

  • getServerSideProps

Question 9

Which method runs only at build time and never on the client or request?

  • getServerSideProps

  • fetch()

  • generateStaticParams

  • getStaticProps

Tags:

There are 9 questions to complete.

Take a part in the ongoing discussion