Question 1
What is the primary advantage of using React Hook Form over manually handling forms in React?
It automatically writes CSS for forms
It reduces boilerplate by simplifying form state and validation
It removes the need for useState in the application
It only works with class components
Question 2
In React Hook Form, what happens if a required field is left empty during submission?
The form submits normally
The entire app crashes
An error message is triggered
The field is automatically filled with a default value
Question 3
What is the purpose of the "use server" directive in Next.js?
To mark a function for client-side execution
To specify that a function runs only once
To designate a function as a server action
To enable React state management
Question 4
Which statement best differentiates React Hook Form from Server Actions in Next.js?
Both are used for state management only
React Hook Form handles form validation on the client, while Server Actions securely process data on the server
React Hook Form is for routing, while Server Actions are for styling
Both are limited to TypeScript-only projects
Question 5
What is the primary purpose of the revalidatePath function in Next.js?
To delete cookies on the client side
To re-render the UI instantly without caching
To manually revalidate cached content of a page or layout
To validate form inputs before submission
Question 6
Which optional parameter can be passed to revalidatePath to define what is being revalidated?
'form' or 'state'
'page' or 'layout'
'cookie' or 'session'
'server' or 'client'
Question 7
In Next.js, which components have direct access to the cookies() function?
Client Components only
Both Client and Server Components
Middleware only
Server Components only
Question 8
Which cookies() method checks if a specific cookie exists?
cookies().has(name)
cookies().exists(name)
cookies().check(name)
cookies().getAll(name)
Question 9
What is the main goal of adding form validation in Next.js?
To improve the speed of API routes
To ensure accuracy and validity of user input
To automatically create cookies for users
To generate static pages dynamically
Question 10
Which statement correctly differentiates cookies, revalidatePath, and form validation in Next.js?
Cookies handle caching, revalidatePath secures data, and form validation manages authentication.
Cookies store small data securely, revalidatePath refreshes static pages, and form validation ensures correct user input.
Cookies validate input, revalidatePath manages tokens, and form validation clears cache.
Cookies and revalidatePath are both client-side only, while form validation is server-side only.
There are 10 questions to complete.