-
Notifications
You must be signed in to change notification settings - Fork 61
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
Race condition is back on setState #19
Comments
Oh, yes. Maybe, it isn't clear enough in README. But, that's the base idea of this library. In TypeScript, it will clearly show a compile error, it should probably show a runtime error too for JavaScript. |
const initialState = {
user: null,
}; It can be just |
can be closed, thanks. |
So I started using a 3rd party api that loads side by side the initial render. When setGlobalState is called, the first render does not notice the state was changed.
A second forced render a second later, picks up on the change. Something is making observableBits crap out, and I am not sure I could easily replicate this.
Is there anywhere in the code here, if setState gets called, it wont render upon initial render.
EDIT: I traced this bug/feature, hoping its a bug. If the initialState does not define the field, during first render it gets skipped over.
Broken code
Working code
The text was updated successfully, but these errors were encountered: