I have a requirement to serve pre-rendered pages to real users and make them interactive. The website uses React (Next.js).
Instead of returning an empty <div id="__next" />
, and letting React render the components, the page returns the entire DOM tree inside that div
. The problem here is that interactions on the page do not work anymore, probably because React is not creating the components.
A simple click on a menu does not expand the options, for example.
Is there a way to make React work on a pre-rendered page?
I installed React Developer Tools
to check if I could see all the components, but I got stuck with Loading React Element Tree...
, probably because React is not working properly. React Developer Tools
works correctly on the original website.