Open ldiaz-occ opened 3 years ago
Making some tests in the Codesandbox example with different react-jss
versions, it seems like this problem is happening since 10.0.1
, so I guess this is a long-lasting thing. With version 10.0.0
stylesheets are finally removed correctly, and I'm not receiving the Rule is not linked
warning anymore, but I don't know if it is because it wasn't implemented in that version yet.
None of the bug fixes of 10.0.1
mentioned in the changelog suggests that this should have changed, so I'm curious about what happened between 10.0.0
and 10.0.1
.
Hi @ldiaz-occ I am having this problem with v10.10.0
did you figure out what was happening?
Expected behavior: When a component unmounts its stylesheets should be removed from the head.
Describe the bug: The stylesheets attached to the head don't include the name of the component in the
data-meta
attribute. I guess this is why JSS can't remove the stylesheet when the component unmounts.Reproduction: I can reproduce the error with
react-jss@10.7.1
using thewithStyles
HOC or thecreateUseStyles
hook. But in the10.6.0
version it just happens with the hook. The styles attached with the HOC work fine. Here is an example in Codesandbox. In the example I'm using version 10.6.0. If the version is changed to 10.7.1 non of the cases works.Versions (please complete the following information): Dependencies:
Managing expectations: I've been seeing the
Warning: [JSS] Rule is not linked. Missing sheet option "link: true".
message in the terminal (not in codesandbox but in my Next.js project), but no idea if it is related.