Open CupNoodleFork opened 8 years ago
hi @CupNoodleFork. if i understand correctly, is the problem that when navigating back and forth between the same two routes too quickly you're unable to rely upon componentWillMount
because neither of them had actually unmounted?
Same problem here. @CupNoodleFork, did you resolve the issue?
I'm experiencing the same issue. @maisano it seems that if you navigate once and then before the transition time has elapsed from that transition, then you navigate a second time (clicking a link, etc), there is an undesirable overlap in the pages.
Perhaps as a workaround, you could advise on how to speed up the transitions? While this does not quite fix the issue at hand, at least there is less opportunity for this behavior to occur.
Just noticed this in the closed issues: https://github.com/maisano/react-router-transition/issues/10
@CupNoodleFork FWIW, updating my code to make use of faster transitions did help this problem stop showing up. I believe the issue is still there, but nobody encounters it anymore.
@jmhuret thx, faster transitions may work.
@maisano yes. I'm unable to do something in componentWillMount
, but it seems reasonable when in transition.
@jmhuret that overlap is currently working as designed. spring animations are meant to be interruptible, so if you spam /a
-> /b
-> /a
and so on, the component that was previously animating out will animate back in from its current position. i'm not sure subverting this in a reasonable manner is possible with react-router-transition as we use react-motion under the hood.
I switch between two paths repeatedly,until the animation finished,then the last route Component will unmount actually. so, I can not do something in
componentWillmount
in the last Component