#Math.random() overwritten on hydration

1 messages · Page 1 of 1 (latest)

mint vigil
#

I have a skeleton component which I want to have a slight randomness to its width, so I have

<span class="skeleton-text text-clip whitespace-nowrap">{"a".repeat(7 + Math.floor(Math.random() * 20))}</span>```

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 ![pepesaber](https://cdn.discordapp.com/emojis/742438961137451089.webp?size=128 "pepesaber")
#

(wait when did discord add bullet point rendering 👀)

mint vigil
#

Changing renderAsync to renderStream in entry-server fixed this issue.