-
-
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
UNCHANGED doesn't equal UNCHANGED when I npm link a library which is using mobx #1742
Comments
@capaj I think this one could be fixed by storing UNCHANGED on the global state object instead of having it as module constant. Note that it might not be the last of your issues though, and if you could prevent linking / multiple instances that would be better :) |
Created fix, will be part of next version |
Released in 4.7.0 / 5.7.0 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions. |
So I was having a fun afternoon trying to figure out why mu observable is being populated with an empty object instead of my value when I call
set()
.There is this
UNCHANGED
mobx/src/types/observablevalue.ts
Line 36 in f944b54
which is being compared to a
newValue
here:mobx/src/types/observablemap.ts
Lines 185 to 187 in f944b54
And in my case the
prepareNewValue()
indeed returnedUNCHANGED
, but it didn't equal even though my newValue was the same as current value.Look:
I stored the other
UNCHANGED
on my window and that equaled.The reason why it doesn't equal is that I used
npm link
to load up a different version of mobx. And since webpack then loads multiple modules of mobx, when you use aset
from one on another it just does really weird stuff.Worst thing is-not even a peer dependency helps.
@mweststrate wasn't there some kind of warning when you loaded up multiple mobx modules at once?
The text was updated successfully, but these errors were encountered: