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

React strict mode forces dynamic rules to be added twice which breaks hydration #1643

Open
yung-danny opened this issue Apr 11, 2023 · 0 comments

Comments

@yung-danny
Copy link

Expected behavior:
Consistent jssId and ruleCounter with strict mode

Describe the bug:
Using React Strict Mode wrapper forces dynamic rules to be generated twice on client. On next js server they are generated only one time. This all leads to classes mismatch by counter at some point

Reproduction:

https://codesandbox.io/p/sandbox/upbeat-grothendieck-9ne4d2
Look how input, text and container classes in dom are 1 step behind from generated on client stylesheets with strict mode enabled

Versions (please complete the following information):

  • jss: 10.10.0
  • Browser [e.g. chrome, safari]: Chrome
  • OS [e.g. Windows, macOS]: macOs
  • React: 18.2.0
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

No branches or pull requests

1 participant