Is your feature request related to a problem? Please describe.
Hey! Our application has some very intricate animations; some are handled by the router and implement transitions between pages, and others are motion.div within various components. Unfortunately these sometimes fight against each other and a solution would be to disable animations for certain parts of the React tree during transitions. We can't use MotionGlobalConfig.skipAnimations because we need some animations to run.
Describe the solution you'd like
I'd like to add skipAnimations as an option to transition. That means that I could put <MotionConfig transition={{ skipAnimations: isTransitionRunning }}> around the bits of the tree that shouldn't animate during a transition.
Describe alternatives you've considered
I've tried MotionConfig with {{ duration: 0 }} which works, but then causes a jank when I turn it back up.
I've also tried wrapping the motion components in a Proxy which disables them if transitions are running and using this set of components instead of the originals, but I can't get it to work (and anyway it seems complicated).
Additional context
I've had a look at the code and although I haven't tried yet, from a first view I think this wouldn't be too hard to implement. I am going to have a fiddle and see if there are any hidden complications.
Is your feature request related to a problem? Please describe. Hey! Our application has some very intricate animations; some are handled by the router and implement transitions between pages, and others are
motion.div
within various components. Unfortunately these sometimes fight against each other and a solution would be to disable animations for certain parts of the React tree during transitions. We can't useMotionGlobalConfig.skipAnimations
because we need some animations to run.Describe the solution you'd like I'd like to add
skipAnimations
as an option totransition
. That means that I could put<MotionConfig transition={{ skipAnimations: isTransitionRunning }}>
around the bits of the tree that shouldn't animate during a transition.Describe alternatives you've considered
MotionConfig
with{{ duration: 0 }}
which works, but then causes a jank when I turn it back up.Additional context I've had a look at the code and although I haven't tried yet, from a first view I think this wouldn't be too hard to implement. I am going to have a fiddle and see if there are any hidden complications.