- JavaScript
- React
JavaScript
In a real React app, obtain
rootElement with useRef and a useEffect (or render the wrapper in the same tree) so you do not call document.getElementById during SSR. See React integration for patterns that match your app.