Hello! I was trying to animate a sidebar using GSAP decorator.
Aside from animation, this sidebar also can be hidden via changing the className basing on component props.
But for some reason, the decorated component not always renders with the updated class. When I inspect element, it still shows the old class, although in the React Developer Tools I see the new className prop.
Thanks for this issue! I haven't been able to reproduce it so far. Here is how i tried but it works for me and i have no idea at the moment how can this error happen.
Can you please help me reproducing it? (You could fork my pen)
The fork works fine, even when inserted into my project. Perhaps there's something in my other components that messes with rendering. I'll try to look into this again.
Hello! I was trying to animate a sidebar using GSAP decorator. Aside from animation, this sidebar also can be hidden via changing the className basing on component props. But for some reason, the decorated component not always renders with the updated class. When I inspect element, it still shows the old class, although in the React Developer Tools I see the new className prop.
Here's the code of my component:
So, when visible prop is changed to false, the sidebar should re-render with the className sidebar. Sometimes it does, sometimes not.
I tried to find what's preventing class change, and found that commenting
(0, _utils.saveRenderedStyles)(this.__itemTree);
in this code helps:Could you please look into this or tell me if I'm doing something wrong?