-
Notifications
You must be signed in to change notification settings - Fork 801
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
this.state becoming null in mobx-react observer-wrapped component #1235
Comments
100% due #1207 |
Running your example right now, and it's working without any issues. |
Hm, that's odd. I just tried this repo on a different host, and am still seeing the same issue. Do you have a similar video of your interaction? Are you doing the steps of: toggle, hot-reload, toggle? Are you using all the same platform versions? Let me know also if I can submit more videos, if I can do any debugging on your behalf, or if there's anything else I can do from my end to help with this issue report. Thanks for taking the time to look into this. |
Tried again in the "right" order and it got broken :) |
You know - we had almost the same issue before, I clearly remember it. Look like |
Oh, holy 💩! I make a wrong PR! That's what's happening without tests. It uses |
Another approach is to use |
....and that's already made? |
Description
What you are reporting:
Bug (or my own misunderstanding). When I edit a stateful class component that is wrapped in an
observer()
from mobx-react,this.state
becomes null at some point, during a render attempt.Expected behavior
What you think should happen:
this.state
should never change to null.Actual behavior
What actually happens:
this.state
changes to null.Environment
React Hot Loader version:
Run these commands in the project folder and fill in their results:
node -v
: 10.15.1npm -v
: 6.8.0yarn -v
: 1.13.0Then, specify:
Reproducible Demo
I just did create-react-app, eject, and added hot-loader + mobx-react, before reproing the bug:
https://github.com/yang/hot-cra-observer-repro
Video of reproing the error: you must first click to toggle off the Widget, then trigger a hot-reload in the Widget, and then click to toggle the Widget back in.
https://youtu.be/47AaO8IEwqo
The text was updated successfully, but these errors were encountered: