question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple instances of Mobx in v4

See original GitHub issue

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 ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aTablecommented, Jul 2, 2018

I guess it’s an unofficial beta at this stage

npm i react-native-router-flux@4.0.0-beta.32

0reactions
aksonovcommented, Aug 8, 2018

Latest version no longer uses mobx, closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple MobX instances in your application #1082 - GitHub
For this reason, the rule of thumb is that there should be only one instance of the MobX library in your application. Otherwise,...
Read more >
Defining data stores - MobX
Your application will contain one or multiple domain stores. These stores store the data your application is all about. Todo items, users, books,...
Read more >
There are multiple mobx instances actives - Stack Overflow
I just created a simple observable object, with the following code: import React, { Component } from "react"; import { observable } from...
Read more >
mobx-react - npm
Exports the observer decorator and other utilities. For documentation, see the MobX project. This package supports both React and React Native.
Read more >
React Mobx Multiple Stores - StackBlitz
2. 3. 4 ... import { observer } from 'mobx-react';. import './style.css';. import './Testing';. import { Provider } from 'mobx-react';.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found