April 2020
Intermediate to advanced
716 pages
18h 55m
English
The markup and CSS that we generated on the server must be added to the template.js HTML code for it to be loaded when the server renders the template.
mern-skeleton/template.js:
export default ({markup, css}) => { return `... <div id="root">${markup}</div> <style id="jss-server-side">${css}</style> ...`}
This will load the server-generated code in the browser before the frontend script is ready to take over. In the next section, we will learn how the frontend script needs to account for this takeover from server-rendered code.
Read now
Unlock full access