admin管理员组文章数量:1317894
I have a fairly complex page that contains several nested layers of React components inside a Framer Motion <LayoutGroup>
, containing a large number of leaf <motion.div>
instances. What I want to do is perform some state update and then wait for all nested child animations to complete before performing another action.
Is there an easy way to do this without a ton of manual coordination? I can see that it would be possible for me to attach onAnimationStart
and onAnimationComplete
callbacks all over the place, but it seems really painful to keep track of how many animations are pending, as well as differentiating the start state (when onAnimationStart
hasn't fired yet) from the end state. Keeping track of these counts also seems like it will leak a lot of 'implementation details' of my hierarchy -- really I'd ideally like to be able to add and remove <motion.div>
from deeply nested child components without needing to go update some global animation coordinator logic.
本文标签: javascriptWait for all FramerMotion LayoutGroup animations to completeStack Overflow
版权声明:本文标题:javascript - Wait for all FramerMotion LayoutGroup animations to complete - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742037071a2417354.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论