Open dutzi opened 4 years ago
Hey @davidkutas, not 100% sure I follow, but maybe you could do it using useRef
?
Define a ref to some value, 0.
When clicking on an item, set the value to be the index of the item clicked.
Inside the transition handler (onLeave
), read the ref's value and trigger the appropriate animation.
@dutzi Thank you for the answer; I'll try.
This is so great thank you. However unfortunately i cant get it working with React Router switch. Either the enter or leave calls are bypassed. All working without the switch. I note you haven't used it in the example. Can you offer any insight?
Hey @a2thab, thanks for bringing it up. I can think of one reason why this could happen, is there an environment where I can reproduce it?
To be honest i'm not so keen to make it public at the moment. It's good to know that it should work. I'm sure i'll sort it out eventually. I'm new to React so it's bound to be a rookie mistake.Thanks again Eldad
On Sun, Oct 18, 2020 at 5:23 AM Eldad Bercovici notifications@github.com wrote:
Hey @a2thab https://github.com/a2thab, thanks for bringing it up, I can think of one reason why this could happen, is there an environment I can see it happen on?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dutzi/dutzi.github.io/issues/31#issuecomment-711060893, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARB445RT265HHJXPKLNQPADSLHOKFANCNFSM4L7PRYBA .
No problem, I'll try setting up a similar environment in the coming days
I’d really appreciate that. I’ll jump on if I work it out before..by some miracle of evolution :)
On 18 Oct 2020, at 9:50 pm, Eldad Bercovici notifications@github.com wrote:
 No problem, I'll try setting up a similar environment in the coming days
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Dear reader,
I'm using Github Issues as a platform for discussion (using Gitalk).
You can join the conversation either by commenting here, or in my blog 🌈