cssinjs/jss

themed useCreateStyles creates className mismatch when hydrating in StrictMode

开放

#1,338 创建于 2020年4月26日

 (0 条评论) (1 个反应) (0 位负责人)JavaScript (434 个派生)batch import
bughelp wanted

仓库指标

星标
 (7,000 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Expected behavior: className matches during hydration

Describe the bug: The counter in the className is off by one

Codesandbox link: https://codesandbox.io/s/createusestyles-classname-mismatch-zdojq?file=/src/App.js

The useLayoutEffect warnings are false positives since we SSR in the browser to showcase the issue better. Versions (please complete the following information):

  • jss: 10.1.1
  • Browser [e.g. chrome, safari]: Chrome 81
  • OS [e.g. Windows, macOS]: ubuntu 18.04
  • react: 16.13.1

贡献者指南