question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] onAnimationComplete pass variant as param

See original GitHub issue

Currently I’m not sure how to determine which animation variant completed in the onAnimationComplete callback. For instance I’d like to know when the exit transition has fully completed inside AnimatePresence so I can disable scroll locking after closing a modal. In Pose I used:

onPoseComplete={thePose => {
  if (thePose === "exit") {
    doStuff();
  }
}

Describe the solution you’d like Pass the related variant string as argument to onAnimationComplete like onPoseComplete?

Edit: Noticed I can use the onExitComplete callback on AnimatePresence itself but would still be useful to know which animation completed on a motion level.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

3reactions
mattgperrycommented, Feb 19, 2021

Published in 3.6

0reactions
alexis-regnaudcommented, Dec 28, 2020

Any update on that one ? It’s too bad to have to use another external state in order to make the difference between the different states 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Motion components | Framer for Developers
Animate via a simple prop. Add drag, pan, hover and tap gestures. Respond to gestures with animations. Deeply animate throughout React trees via...
Read more >
c++ - How to pass a variant as constructor parameter or as ...
I try to create a construction that take a variant parameter to initialize the state. However whent the constructor is defined , I...
Read more >
Using Animation Events
These fields allow you to specify the name of the function you want to call, and the value of the parameter you want...
Read more >
Framer Motion: Start an Animation on Hover
Well, we can now tell the div to start the animation, but it doesn't know what to animate. This is where animation variants...
Read more >
How To Use std::visit With Multiple Variants and Parameters
... capabilities of this handy function: the basics, applying on multiple variants, and passing additional parameters to the matching function.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found