You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spin up the app in your simulator/emulator and enable fast-refresh.
Change something in the App component.
Save App.js
Describe what you expected to happen:
The app throws a red screen with the error message in the beginning of the issue, instead of updating the component with the change.
The text was updated successfully, but these errors were encountered:
I can look into it after I'm back from vacation (please remind me if I don't, and not here, because GH notifications are useless.)
I don't have confidence that this is a bug in Fast Refresh. It should work fine when you use idiomatic React, but mobx is a bit of a special case since it relies on mutation so much, and there's likely a few unusual tricks that it's doing.
As I wrote in mobxjs/mobx-react-lite#226 (comment), Fast Refresh "frees" useMemo / useCallback, and re-runs all effects once. We can't do it differently — that's the whole premise of the feature. If that behavior breaks mobx, mobx can probably adapt to it.
See mobxjs/mobx-react-lite#226 (comment) — this is expected behavior given Fast Refresh semantics, and something that should be possible to fix in Mobx.
Fast refresh does not work with components wrapped in a mobx observer. It fails with the below message.
Related issue in mobx-react repo: mobxjs/mobx-react-lite#226
React Native version: 0.61.2
Steps To Reproduce
mobx-react
App.js
and wrap yourApp
component in an observerApp
component.App.js
Describe what you expected to happen:
The app throws a red screen with the error message in the beginning of the issue, instead of updating the component with the change.
The text was updated successfully, but these errors were encountered: