sPavl0v / react-spa-prenderer

MIT License
34 stars 17 forks source link

Page goes blank between initial render and rerender #18

Open dominiczy opened 2 years ago

dominiczy commented 2 years ago

I'm using react-spa-prerender on my site https://traverse.link/, but I've noticed that the page becomes blank between the initial render of the static html, and the rerender of the React component. When logged out it's just a second, but when logged in it's much longer (maybe because a lot of JS needs to run?).

Any idea why the page goes blank rather than keeping the static html rendered, and how to fix it?

sPavl0v commented 1 year ago

Hi @dominiczy, good point, this question relates to react hydration process. Currently i can't say anything helpful, but can you please specify React version you're using?

dominiczy commented 1 year ago

@sPavl0v I was using React 16 then, I've upgraded to React 18 since but haven't tried react-spa-prenderer yet - do you think React 18 would solve the issue?

aayusharyan commented 1 year ago

This is related to react hydration. Check if the index.js file. Also, I am using this with React 18, seems to work fine.