Math.random() overwritten on hydration
I have a skeleton component which I want to have a slight randomness to its width, so I have
However, on hydration, the inner text of the span is removed.
I have 2 questions:
1) Why, instead of re-rendering with different randomness, does it just disappear?
2) Can I stop hydration of this skeleton component to only use the ssr sent inner text?
- Raz
2 Replies
(wait when did discord add bullet point rendering 👀)
Changing renderAsync to renderStream in entry-server fixed this issue.
1. hydration requires that the server markup and the client's initial render to match. It's no longer hydration if it just replaces the content.