May 2018
Intermediate to advanced
470 pages
13h 54m
English
Once the code rendered on the server side reaches the browser, and the frontend script takes over, we need to remove the server-side injected CSS when the main component mounts. This will give back full control over rendering the React app to the client side:
mern-skeleton/client/MainRouter.js:
componentDidMount() { const jssStyles = document.getElementById('jss-server-side') if (jssStyles && jssStyles.parentNode) jssStyles.parentNode.removeChild(jssStyles)}
Read now
Unlock full access