cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

dynamic css issue under a certain condition since version 10.9.1-alpha.1 #1630

Open pei-wang opened 1 year ago

pei-wang commented 1 year ago

Expected behavior: work same as 10.9.1-alpha.0

Describe the bug:

when my component get re-rendered several times and it depends on another component which use dynamic function. then the dynamic css class of the dependent component is missing. From what I observer: there are several prerequisites to trigger the issue.

  1. make some operations to cause components re-render
  2. having a nested element inside a dynamic css function.

Reproduction:

https://codesandbox.io/s/stupefied-minsky-lw7wxs

Versions (please complete the following information):

Managing expectations:

Maintainers will not be fixing the problem you have unless they have it too, if you want it to get fixed:

  1. Submit a PR with a failing test
  2. Discuss a solution
  3. Implement it

You can also do the first step only and wait for someone else to work on a fix. Anything is much better than nothing.

pei-wang commented 1 year ago

caused by https://github.com/cssinjs/jss/pull/1609/. But I haven't seen any thing wrong in that PR. I need to dive into to find more. cc: @enisdenjo

ynaut commented 1 year ago

we've had a similar issue were dynamic rules would be removed after re-rendering React components. We have the issue 10.9.1 but not in 10.9.0

Suspect it's related to the change in: https://github.com/cssinjs/jss/pull/1604