Next.js SSR example question
See original GitHub issueIn the nextjs example pages/_app.js
componentDidMount() {
// Remove the server-side injected CSS.
const jssStyles = document.querySelector('#jss-server-side');
if (jssStyles && jssStyles.parentNode) {
jssStyles.parentNode.removeChild(jssStyles);
}
}
Why remove the injected css ?
I use koa to deploy the nextjs app, after I build it. The styles will be removed if I add this.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Top 20+ Next JS Interview Questions 2022 - MindMajix
Next JS Interview Questions · Can you use Next JS with Redux? · What do you mean by SSR? · What is DOM?...
Read more >Top 40 Next.JS Interview Questions & Answers 2023 | MindMajix
This MindMajix video on Next JS Interview Questions and Answers video includes all the frequently asked Interview questions that give you an ...
Read more >20 Next.js Interview Questions and Answers - CLIMB
8. What is SSR (Server Side Rendering)? Why is it important for Next.js applications? ... Server Side Rendering (SSR) is the process of...
Read more >Next JS Server Side Rendering (SSR) Implementation ...
NextJs is a great framework that offers many features for enhancing NextJS SEO optimization and user-experience. One staple feature is server side rendering ......
Read more >React Next.js - Three related questions about SSR patterns
This is true whether you're using SSR (the html is created on demand on the server) or SSG (the html is created at...
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 Free
Top 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
So can we disable the generation of injection of <style id="jss-server-side">html {…} into the HTML so we don’t need to manually remove it in the client side script?
@oliviertassinari That’s clear, thanks for your help.