Complete the code to enable ISR by setting the revalidate time in seconds.
export const revalidate = [1];Setting revalidate to 60 means the page will regenerate at most once every 60 seconds.
Complete the code to export a Next.js page component that uses ISR.
export default function Home() {
return <main>[1]</main>;
}The component must return valid JSX to render the page content.
Fix the error in the ISR page by completing the export of the revalidate time.
export const revalidate = [1];The revalidate value must be a number, not a string or boolean.
Fill both blanks to create a page that fetches data and uses ISR with 120 seconds revalidation.
export async function [1]() { const res = await fetch('https://api.example.com/data'); const data = await res.json(); return { props: { data } }; } export const revalidate = [2];
getStaticProps is used for static generation with ISR, and revalidate sets the regeneration time.
Fill all three blanks to create a Next.js page that fetches data, uses ISR with 30 seconds, and displays the data.
export async function [1]() { const res = await fetch('https://api.example.com/items'); const items = await res.json(); return { props: { items } }; } export const revalidate = [2]; export default function ItemsPage({ [3] }) { return ( <ul> {items.map(item => <li key={item.id}>{item.name}</li>)} </ul> ); }
Use getStaticProps to fetch data for ISR, set revalidate to 30 seconds, and receive items as props to render.