Reviewing my code on the development server
function Home(props) {
console.log("Hello")
return (
<ul>
{props.user.map((user) => (
<li key={user.id}>{user.email}</li>
))}
</ul>
)
}
export default Home
export async function getStaticProps() {
const res = await fetch('https://jsonplaceholder.typicode.com/users')
const data = await res.json()
return {
props: {
user: data,
},
revalidate: 10,
}
}
After running npm run build and starting the actual server with npm run start
If I make a change to my JSX from
<li key={user.id}>{user.email}</li>
to
<li key={user.id}>{user.username}</li>
And wait for some time, the page remains unchanged -> It still displays user.email instead of user.username