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

(Warning) Multiple mobx instances running #2155

Closed
rota-rossi opened this issue Aug 1, 2017 · 5 comments
Closed

(Warning) Multiple mobx instances running #2155

rota-rossi opened this issue Aug 1, 2017 · 5 comments

Comments

@rota-rossi
Copy link

Hi, folks. I just added mobx to my RN project, and I'm receiving the warning below. Am I doing something wrong?

[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See mobxjs/mobx#1082 for details.

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.15
  • react-native v0.46.4
  • mobx v3.2.2
  • mobx-react v4.2.2

Expected behaviour / Actual behaviour

So far, no problems found (except for the warning message)

The step-by-step

  1. added mobx and mobx-react to project
  2. added babel-plugin-transform-decorators-legacy to project
  3. created a new store (so far, 3 observables and one computed), using decorators
  4. add Provider to Project root Component
  5. use inject and observer in Components, also using decorators.
@rota-rossi
Copy link
Author

I 'solved' the issue by downgrading my mobx and mobx-react versions for the same used by RNRF.

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017

Feel free to upgrade RNRF's dependencies and submit PR.

@rota-rossi
Copy link
Author

I don't know if it would be just that.
The proper way (as I understood) is actually to change the mobx packages to be a peer dependency here. But this way, the users will need to install by hand mobx and mobx-react, even if they do not plan to use it (peerDependencies are not installed by default).
Should I proceed on this path?

@aksonov
Copy link
Owner

aksonov commented Aug 2, 2017

Could you just upgrade dependencies to match latest mobx version, without peerDependencies?

@aksonov
Copy link
Owner

aksonov commented Aug 7, 2017

Closed due inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants