react-component / motion

⛷ CSS Animation for React
https://motion-seven.vercel.app
MIT License
146 stars 39 forks source link

State not always up to date #36

Open maxired opened 1 year ago

maxired commented 1 year ago

Hi,

I am trying to trace the root cause of https://github.com/ant-design/ant-design/issues/38818 , and I believe this is related to rc-motion, either being buggy on react-18, or maybe misused.

Here is a sandbox where I can repo the issue https://codesandbox.io/s/small-moon-nigikp?file=/src/App.js

https://user-images.githubusercontent.com/1194083/203934195-bbaab64f-fd94-44c8-9b66-c292e4e6ceed.mov

as you can see, the element does not seems to end up in the state it is supposed to be, as sometimes Parent is hovered, but child is not visible

GaneshSrambikal commented 1 year ago

Maybe passing the dependencies in the useEffect would do the work