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
I was trying to configure and use mobx as my default state management, but I had some problems while configuring it, because the new version of mobx@4.1.0 and mobx-react@5.0.0, only accepts 1 instance.
react-native-router-flux uses and old version for both of them and is configured as devDependencies
inside of package.json.
Actual behaviour
It's crashing the application after importing an observable, printing the following output:
[mobx] There are multiple mobx instances active. This might lead to unexpected results: See https://github.com/mobxjs/mobx/issues/1082 for details.
Install mobx and mobx-react with the latest version: npm install mobx mobx-react
Create a simple observable object and import it in App.js or even in index.js
It's expected to output the following error [mobx] There are multiple mobx instances active. This might lead to unexpected results: See https://github.com/mobxjs/mobx/issues/1082 for details..
Steps to fix
There is a topic created by the developer of Mobx, explaining how to fix this issue for "library developers", mobx issue #1082.
My workaround to fix this problem, was adding the property resolutions to my package.json and use yarn as package manager. This is my package.json
Version
Tell us which versions you are using:
Expected behaviour
I was trying to configure and use mobx as my default state management, but I had some problems while configuring it, because the new version of
mobx@4.1.0
andmobx-react@5.0.0
, only accepts 1 instance.react-native-router-flux
uses and old version for both of them and is configured asdevDependencies
inside of
package.json
.Actual behaviour
It's crashing the application after importing an
observable
, printing the following output:[mobx] There are multiple mobx instances active. This might lead to unexpected results: See https://github.com/mobxjs/mobx/issues/1082 for details.
Steps to reproduce
react-native
project.react-native-router-flux
:npm install react-native-router-flux
mobx
andmobx-react
with the latest version:npm install mobx mobx-react
observable
object and import it inApp.js
or even inindex.js
[mobx] There are multiple mobx instances active. This might lead to unexpected results: See https://github.com/mobxjs/mobx/issues/1082 for details.
.Steps to fix
There is a topic created by the developer of Mobx, explaining how to fix this issue for "library developers", mobx issue #1082.
My workaround to fix this problem, was adding the property
resolutions
to mypackage.json
and useyarn
as package manager. This is mypackage.json
Then, I just run
yarn install
andreact-native run-android
.The text was updated successfully, but these errors were encountered: