Files
Basalt2/node_modules/shiki/samples/tsx.sample
Robert Jelic 5c15cf28fa Test
2025-02-10 07:12:35 +01:00

27 lines
506 B
Plaintext

// posts will be populated at build time by getStaticProps()
function Blog({ posts }) {
return (
<ul>
{posts.map((post) => (
<li>{post.title}</li>
))}
</ul>
)
}
// This function gets called at build time on server-side.
export async function getStaticProps() {
const res = await fetch('https://.../posts')
const posts = await res.json()
return {
props: {
posts
}
}
}
export default Blog
// From https://nextjs.org/docs/basic-features/data-fetching