0
3
JRJose Romero
nextgetServerSidePropspageβ’β’β’
Next TypeScript recipesIf you export a function called getServerSideProps
(Server-Side Rendering) from a page, Next.js will pre-render this page on each request using the data returned by getServerSideProps
.
Library: next
Shortcut: next.page.server.props.create
Filename pattern: pages/**/*.tsx
type Props = {
}
function NextPage(props:Props) {
}
// This gets called on every request
export async function getServerSideProps() {
return { props: { } }
}
export default NextPage;