[react-jss] No critical css generated on server
See original GitHub issueExpected behavior:
const sheets = new SheetsRegistry();
const html = ReactDOM.renderToString(
<JssProvider registry={sheets}>
<App />
</JssProvider>
);
const css = sheets.toString();
css
should not be empty.
Describe the bug:
It seems that SheetsRegistry return empty string in toString
method because no stylesheet is attached. Example repo: https://github.com/bungu/jss-no-critical-css
It works in v9
Versions (please complete the following information):
- JSS: v10.0.0-alpha.13
- React-JSS: v10.0.0-alpha.6
$ npm list jss react-jss
jss-no-critical-css@0.1.0 ~/sandbox/jss-no-critical-css
└─┬ react-jss@10.0.0-alpha.6
└── UNMET PEER DEPENDENCY jss@10.0.0-alpha.13
npm ERR! peer dep missing: jss@10.0.0-alpha.3, required by jss-preset-default@10.0.0-alpha.7
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Inlining critical CSS - Kevin Farrugia
This technique works both with CSS modules and not and can be easily added to an existing project. Performance-First React Template. While writing...
Read more >Dynamically Inlining Critical CSS with Server-side JavaScript
The package we use to generate our critical CSS is PurifyCSS. It takes HTML and a stylesheet, then returns only the CSS which...
Read more >My Experiences with Optimizing CSS for React Frontends
Like critical, it can be integrated during the build-time to generate HTML with optimized CSS. My experience with UnCSS: I found UnCSS to...
Read more >Eliminate Render-blocking Resources using React and ...
After checking each file and the generated index.html after the build, I found three primary non-critical files -. a. 5.20aa2d7b.chunk.css - 98% ...
Read more >Why is a statically generated page unstyled when sent to the ...
... similar to Next.js' website, you need to inline critical CSS. ... start ) not a dev one like you're doing in that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed, will be released in 10.0.0-alpha.14
Well done 😃