UI does not update on state change
See original GitHub issueCurrently it seems the active
param doesn’t listen to the provided state, as a result it doesn’t seem to update when the state changes.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:9 (2 by maintainers)
Top Results From Across the Web
React ui not updating although i'm changing the state
Issue. The issue here is one of state mutation. You are mutating a reference to the current state and then saving it back...
Read more >Why React doesn't update state immediately - LogRocket Blog
State updates in React are asynchronous; when an update is requested, there is no guarantee that the updates will be made immediately.
Read more >Why React setState/useState does not update immediately
The answer: They're just queues. React this.setState , and useState does not make changes directly to the state object. React this.setState ...
Read more >React useState array update not updating the UI fix ... - YouTube
... when we put array item in react state and try to change its value and set the new value to react ......
Read more >React state not updating immediately? - Daggala
You update the state and you expect it to happen immediately but it doesn't. It might seems like the state update isn't updating...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Tnx for the tip @dereksweet, that might work for me.
I can verify this is indeed an issue. So long as you modify the state by clicking the hamburger then it animates properly. If you modify the state outside of the hamburger component the hamburger does not animate.
I got a workaround to work by creating a ref to the hamburger and then calling the
._animate()
function manually whenever I update the state: