- What is the difference between the render() function from react-dom and the renderToString() function from react-dom/server?
- The render() function is only used to sync React component content with the DOM in a browser. The renderToString() function doesn't require a DOM because it renders markup as a string.
- Routing on the server is necessary because:
- The router on the server will determine that content is rendered based on the requested URL. This content is then sent to the browser so that the user perceives a faster load time.
- What function should you use when reconciling server-rendered React markup with React components in the browser?
- Always use hydrate() when the server sends rendered React components. Unlike render(), hydrate() expects rendered component markup and can handle it efficiently.