Skip to content
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

Multiple instances of Mobx in v4 #3100

Closed
Hypothesis-github opened this issue Jun 28, 2018 · 5 comments
Closed

Multiple instances of Mobx in v4 #3100

Hypothesis-github opened this issue Jun 28, 2018 · 5 comments

Comments

@Hypothesis-github
Copy link

Hypothesis-github commented Jun 28, 2018

I am using

 "mobx": "^4.3.1",
    "mobx-react": "^5.2.3",
    "react": "16.3.1",
    "react-native": "~0.55.2",
    "react-native-router-flux": "^4.0.0-beta.31"

and I have gotten the multiple instances since I was already using mobx in react native for routing.
I tackled this ( or at least I think I tackled this) by the instruction provided by the author of react-native-router-flux, which is to search for duplication of mobx in modules, and sure there were 2 extra in react-native-router-flux's node module folder.
package.json also contained a lower version of mobx and mobx-react , I believe v3 or mobx.
so I deleted both folders and the dependency in the package.json and refreshed.
the warning of multiple instances went away. but I have some concerns now.

  1. Npm install brings back both folders of mobx and mobx-react to the module folder of react-native-router-flux. How can I make sure these 2 dependencies will never come back since I deleted the line in react-native-router-flux's package.json as dependency but they still get installed after npm install.

  2. Why the mobx and mobx-react exist in the module folder of react-native-router-flux, and if of course they are handling some actions will they be interrupted because I have deleted the folders manually ?

@aTable
Copy link

aTable commented Jul 2, 2018

Your version of react-native-router-flux ^4.0.0-beta.31" doesn't properly include mobx which is fixed in ^4.0.0-beta.32. This problematic version is the default on npm so, at this time, you'll need to manually upgrade to the latest and this issue is gone.

The creator of mobx outlines the method for properly including mobx in code intended for shared libraries

@Hypothesis-github
Copy link
Author

Hypothesis-github commented Jul 2, 2018

@aTable the latest is 4.0.0-beta.31, I cannot see 32 in the release list https://github.com/aksonov/react-native-router-flux/releases

@aTable
Copy link

aTable commented Jul 2, 2018

I guess it's an unofficial beta at this stage

npm i [email protected]

@catherinetcai
Copy link

If for some reason you don't feel like bumping the version, I was able to workaround this using yarn and resolutions, as outlined here.

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Latest version no longer uses mobx, closing it.

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants