Next page with getServerSideProps

    0

    3

    Jose Romero

    nextgetServerSidePropspage•••
    Next TypeScript recipes

    If 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;
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.