Closed ertankara closed 5 years ago
Duplicate to https://github.com/mobxjs/mobx-react-lite/issues/226
It's more likely the fast refresh is a problem :)
Just noting that the problem was the way they interact, and that a fix is possible. https://github.com/mobxjs/mobx-react-lite/issues/226#issuecomment-541752567
Please update to mobx-react@6.1.4 for the fix.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.
How to reproduce
Wrap your react native function component with
observer
and refresh twice, the first refresh doesn't break it but following refresh does.Erorr is -> Invariant Violation: Rendered fewer hooks than expected. This may be caused by an accidental early return statement.
If I remove the observer it'll refresh without a problem, so I think this issue deserves to be here rather than on React-Native project.