-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Idea: Add option to disallow multiple Mobx versions at the same page #1098
Comments
3.2.0 introduced a warning about multiple instances, according to docs |
Yes, see also the last line of my issue ;-) I'm proposing now to optionally make that an error. |
I'll think there are already too much options around sandboxing / non sandboxing, sharing state etc as it is. I'm fine by printing an error instead of a warning to the console. Actually throwing however sounds as a breaking change, which we could do in the 4.0 release. |
This issue also occurs when doing this: import { observable } from "mobx/lib/mobx";
import { observable as o2 } from "mobx";
console.log(observable === o2); when using es6 modules. The problem is that the VS Code autofix for importing missing variables does the first import, which imports a second copy (mobx.js) while |
From Mobx and upward 4 this will be an error, so closing the issue here :) |
Idea:
So when this option is set in the Mobx config it will throw an error instead of the warning you'd currently get.
The text was updated successfully, but these errors were encountered: