-
Notifications
You must be signed in to change notification settings - Fork 104
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
console.log fixes updating state #183
Comments
Hi! You should wrap all of your components (which are using any Components which are not wrapped with |
They are wrapped in |
I mean all components, not just App.js. Check the |
The whole application is wrapped around |
I see now. What I mean by "wrap all components" is to replace This does two things:
So far you did not do this so all your component re-rendered whenever App re-rendered, and App re-rendered whenever a piece of store it directly used was mutated (this includes the pieces of store inside your TLDR: replace I hope this helps. Let me know if it is still not clear. |
"@risingstack/react-easy-state": "^6.3.0",
node v14.0.0 /
opera Version:68.0.3618.104
"@risingstack/react-easy-state": "^6.3.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"framer-motion": "^1.10.3",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
Describe the bug
A simple console.log() fixes some issues in my application.
reproducing this and in App.js line 18 by removing
console.log('showRes' , store.showRes , store.rndNum)
next time the game is played the button doesn't update the state anymore and remains on the page.For tougher bugs
To Reproduce
https://github.com/hypo-thesis/rpc
Expected behavior
I expect the state management to work without console.log
The text was updated successfully, but these errors were encountered: