-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use in react app #273
Comments
If you server side render it, yes. |
It works even without server side rendering... |
No. Even though critical (the package) might run without throwing any errors, and even return you a critical css - it is not of any use without (some kind of) server side rendering. Critical css is used to enable browsers to render your website before it has loaded CSS + JS, based purely on the initial HTML (i.e. what your server returns) and the critical css. If your HTML is empty, the first render with critical css will be blank, hence no better than not using critical css at all. Google's PageSpeed Insights has in my view been a major culprit as for why people have false conceptions about critical css, as it always just measured signals and never real performance (read more f.e. here), and would hence give thumbs up to things like non server side rendered react + critical css usage despite it making no difference for performance. With the recent update, even PSI should show now more clearly show you the lack of real performance improvement of this type of critical css usage. You don't have to do perfect server side rendering (identical rendering) but if do none, your performance efforts are better spent on something other than critical css. I'm trying to be helpful here so if there's any confusion about what I've written, please tell me! I might write up a blog post about this. |
Closing this because the question is perfectly answered. Thanks @pocketjoso. |
@developer-lindner HOW? |
Can I use critical in react app?
The text was updated successfully, but these errors were encountered: