We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Intended outcome:
Retrieve the object with all its properties when using the spread operator on a mobx observable
Actual outcome:
Retrieve the object without function properties when using the spread operator on a mobx observable
How to reproduce the issue:
export class TestStore { constructor() { makeObservable(this); } @observable test?: object; @action setTest(test: object) { this.test = test; } }
In my React Component
const myObject = {a: "a", b: "b", c: () => console.log("ok")}; console.log("simple var:", {...myObject}); testStore.setTest(myObject); console.log("mobx observable:", {...testStore.test});
Console output:
simple var: {a: "a", b: "b", c: ƒ} mobx observable: {a: "a", b: "b"}
Versions
Doesn't work on the last version:
"mobx": "^6.0.4", "mobx-react-lite": "^3.1.6", "mobx-utils": "^6.0.1",
Works on the previous version:
"mobx": "^5.15.4", "mobx-react-lite": "^2.0.7", "mobx-utils": "^5.6.1",
Thanks
The text was updated successfully, but these errors were encountered:
Please provide runnable reproduction.
Sorry, something went wrong.
https://codesandbox.io/s/mobxbug-949dd
Duplicate of #2629 and #2586
No branches or pull requests
Intended outcome:
Retrieve the object with all its properties when using the spread operator on a mobx observable
Actual outcome:
Retrieve the object without function properties when using the spread operator on a mobx observable
How to reproduce the issue:
In my React Component
Console output:
Versions
Doesn't work on the last version:
Works on the previous version:
Thanks
The text was updated successfully, but these errors were encountered: