YH
Size: a a a
YH
T
YH
h
А
I
А
L
L
EM
EM
EM
L
Б
const sheets = new ServerStyleSheets();
const originalRenderPage = ctx.renderPage;
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) => sheets.collect(<App {...props} />)
});
const initialProps = await Document.getInitialProps(ctx);
initialProps.styles = await minifier.process(initialProps.styles, { from: undefined }); / чтобы что-то типа такого заработало
return {
...initialProps,
styles: [
<React.Fragment key="styles">
{initialProps.styles}
{sheets.getStyleElement()}
</React.Fragment>
]
};
G
L
Б
Б
🦜