Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix chakra-ui hydration issue #430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ImExoOdeex
Copy link

Current example loses styles on hydration (#335).

Emotion with response streaming is generating styles dynamically, just above the element, while client side has all html loaded and can generate the styles in normal way. Current example does not generate client side styles, so when react hydrates, it loses the SSR styles.

This pull simply resets emotion cache when reeact hydrates, in useLayoutEffect, so styles are generated & browser paints them before everything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant