-
-
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
MobX binding fails after deleting property #1730
Comments
Simplified reproduction: https://codesandbox.io/s/n96xrm109l |
I can`t understand your demo |
|
have you compiled the code to es5? |
How does it matter? |
This behavior is working as intended:
EDIT: note that this story only applies to MobX 4! |
How is it then possible that component observes the first addition? Notice that EDIT: Why should mobx support "up-ahead subscription" via |
+1. AFAIK that was mobx 4 that didn't handle dynamic objects. From reading the source it seems mobx 5 has all code required to observe property additions and removals. I also tried to check the dependencies using trace() and they're the same at the beginning and at the end of the test. |
Perhaps it will start working as expected when |
Fixed in MobX 4.5.0 / 5.5.0 |
@mweststrate I am experiencing a similar issue with mobx 5.5.2: const {observable, autorun} = require('mobx');
let value = observable({
foo: undefined, // if foo is something like 'abc', it works.
});
autorun(() => {
console.log(value.foo);
});
delete value.foo;
value.foo = 'def'; |
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. |
Hi,
I have an
With MobX 5 and React: MobX binding breaks after deleting the property.
The sample is here: https://codesandbox.io/s/7z0pxn9v7j
To reproduce the bug:
To continue you can click "force update" and it will rerender the row by another property - after that the binding starts to work again.
The text was updated successfully, but these errors were encountered: