Last active
February 22, 2019 18:59
-
-
Save drwpow/31e84c32f91ecb6d7b57fbb63b0110aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomePage extends React.Component { | |
static getInitialProps() { | |
// This only fires on the first SSR pass | |
} | |
componentDidMount() { | |
// This only fires in the client, when mounted (not on SSR) | |
} | |
… | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
getInitialProps
does not just fire on the server. It will also fire on the client when navigating between pages on client-side (using the next-router)