happens on first navigation
- @server:
p1 = await App.getInitialProps
- calls
Page.getInitialProps
in turn
- calls
- @server:
const html = ReactDOM.hydrate(<App { ...p1 }>);
- @server:
res.send(html, p2 = JSON.stringify(p1)
- @client: parse and show html as usual
- @client:
ReactDOM.render(<App {...JSON.parse(p2) } />)
- causes
const appClient = new App(JSON.parse(p2);
- and
appClient.render() / appClient.componentDidMount()
- causes
happens on consequent navigation-s
- @client:
p3 = App.getInitialProps()
)- calls
Page.getInitialProps
in turn as in the case of SSR
- calls
- @client: render
<App {...p3} />
to existing DOM- do not cause
new App(p3)
: App instance already created/mounted in SSR pass
- do not cause