MCPcopy Create free account
hub / github.com/wesbos/Advanced-React / getInitialProps

Method getInitialProps

stepped-solutions/10/_document.js:5–12  ·  view source on GitHub ↗
({ renderPage })

Source from the content-addressed store, hash-verified

3
4export default class MyDocument extends Document {
5 static getInitialProps({ renderPage }) {
6 const sheet = new ServerStyleSheet();
7 const page = renderPage((App) => (props) =>
8 sheet.collectStyles(<App {...props} />)
9 );
10 const styleTags = sheet.getStyleElement();
11 return { ...page, styleTags };
12 }
13
14 render() {
15 return (

Callers 2

_app.jsFile · 0.45
_app.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected