Hi all, i'm having a play with the new app router atm. I've used NextJS on a previous project using the page router. I'm having some issues with ISR on the new app router. Building the app locally for production and running I can see the time here never updates. I'm probably misunderstanding something, how do we invalidate a server component here?
import Link from 'next/link'
interface User {
id: number
name: string
}
export const revalidate = 10
export default async function UsersPage() {
const response = await fetch('https://jsonplaceholder.typicode.com/users', {
//cache: 'no-store',
next: {
revalidate: 10,
},
})
const users: User[] = await response.json()
return (
<main>
<h1 className={'text-xl'}>Users</h1>
<p>{new Date().toLocaleTimeString()}</p>
<ul>
{users.map((user) => (
<li key={user.id}>{user.name}</li>
))}
</ul>
<br />
<Link className={'text-xl'} href={'/'}>
Home
</Link>
</main>
)
}