Complete the code to set the page to revalidate every 10 seconds.
export const revalidate = [1];Setting revalidate to 10 means Next.js will regenerate the page every 10 seconds.
Complete the code to export a function that fetches data and sets revalidation to 60 seconds.
export async function generateStaticParams() {
// fetch data here
}
export const revalidate = [1];Setting revalidate to 60 means the page will update every 60 seconds.
Fix the error in the code to correctly set revalidation to 15 seconds.
export const revalidate = [1];The revalidate value must be a number, not a string. Remove quotes to fix it.
Fill both blanks to export a page component and set revalidation to 120 seconds.
export default function Page() {
return <h1>[1]</h1>;
}
export const revalidate = [2];The component returns <h1>Hello World</h1> and revalidate is set to 120 seconds.
Fill all three blanks to export a page component that shows current time and revalidates every 5 seconds.
export default function TimePage() {
const now = new Date().toLocaleTimeString();
return <p>[1] {now}</p>;
}
export const revalidate = [2];
export const dynamic = '[3]';The component shows "Current time:" followed by the time. revalidate is 5 seconds, and dynamic is set to 'false' to enable static generation with revalidation.