here's the reproduction: https://codesandbox.io/s/nextjs-inufq
you can see when loading the index page, the red background color flashes into the screen after loading
@lifeiscontent Thank you for reporting the problem. The fix is as simple as:
diff --git a/examples/nextjs/pages/_document.js b/examples/nextjs/pages/_document.js
index 9f17317e6..80f4aa91b 100644
--- a/examples/nextjs/pages/_document.js
+++ b/examples/nextjs/pages/_document.js
@@ -70,8 +70,8 @@ MyDocument.getInitialProps = async ctx => {
// Styles fragment is rendered after the app and page rendering finish.
styles: (
<React.Fragment>
+ {initialProps.styles}
{sheets.getStyleElement()}
- {flush() || null}
</React.Fragment>
),
};
Do you want to submit a pull request to update the examples? :)
Most helpful comment
@lifeiscontent Thank you for reporting the problem. The fix is as simple as:
Do you want to submit a pull request to update the examples? :)