Currently, I am seeing no updating of state. When I am trying to update a useState variable - the variable just fails to update. It could possibly be because using SwitchTransition component somehow changes the block scope. Not sure how, and I could be wrong but that's what I am thinking.
What is the expected behavior?
Expected behavior - Change the useState variable as I want it to.
You will see, if you comment out the SwitchTransition component from App.js file - everything starts working as expected. The entry animations will play when you press Next. The useState variable updates properly.
But as soon as you insert SwitchTransition back - the component stops updating.
Bonus problem/guidance needed - How can I make the exit animation work?
Could you provide a CodeSandbox demo reproducing the bug?
Currently, I am seeing no updating of state. When I am trying to update a
useState
variable - the variable just fails to update. It could possibly be because usingSwitchTransition
component somehow changes the block scope. Not sure how, and I could be wrong but that's what I am thinking.Expected behavior - Change the
useState
variable as I want it to. You will see, if you comment out theSwitchTransition
component from App.js file - everything starts working as expected. The entry animations will play when you press Next. TheuseState
variable updates properly. But as soon as you insertSwitchTransition
back - the component stops updating.Bonus problem/guidance needed - How can I make the exit animation work?
Why, yes. Absolutely. Codesandbox link here