Skip to content

Question about layout head and side effect in library #74741

Discussion options

You must be logged in to vote

Hi, so i believe we've found the error that lead to this behaviour
In the react component we've used document.createElement, which somehow lead to prerendering on the server error (it's marked as use client and document call was inside of react useMemo hook, which should be postponed to hydration because hooks aren't generally available on server side?), and shift in module resolving time to moment where client and server DOM's are not yet reconciliated. After refactoring using refs, everything works fine

P.S. Found a good article about architecture of SSR react components, may be useful (also entry level info about RSC payload)
https://www.smashingmagazine.com/2024/05/forensics-react-ser…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@ivanblinov2k17
Comment options

@ivanblinov2k17
Comment options

@ivanblinov2k17
Comment options

@ivanblinov2k17
Comment options

Answer selected by ivanblinov2k17
@icyJoseph
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants