Open ernestostifano opened 4 years ago
I've continued to test and I've found that the above problem when returning null
is only a sub-case. It seems that previous styles are never being removed (at least in Chrome inspector, you can see styles being accumulated and hopefully overridden on each change. When you return null
there is simply no new style to override the previous). This is only happening with dynamic rule sets as explained above.
I can also confirm that the problem is almost certainly not with react-jss
package. I have my own React implementation of jss
, I'm facing the same exact issue and I've carefully checked every part of my code.
In that case I would recommend to
Without a failing test there will be no mergeable fix. A failing test will also help any contributor to see how to fix the problem better.
NOTE: Similar to https://github.com/cssinjs/jss/issues/1026, but with dynamic rule sets instead of dynamic values.
Just to clarify nomenclature... dynamic rule set Vs. dynamic value:
Expected behavior: Previous applied values to be removed when respective value is set to
null
in a dynamic rule set.Describe the bug: Previous values are not removed causing a number of trouble.
Codesandbox link: https://codesandbox.io/s/fervent-dawn-uomkr
Versions: