Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior while working with useState #888

Open
arkni8 opened this issue Apr 30, 2023 · 0 comments
Open

Unexpected behavior while working with useState #888

arkni8 opened this issue Apr 30, 2023 · 0 comments

Comments

@arkni8
Copy link

arkni8 commented Apr 30, 2023

What is the current behavior?

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?

Why, yes. Absolutely. Codesandbox link here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant