Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
}
}
@kochis

This comment has been minimized.

Copy link

commented Feb 22, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.