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

object with 'toString' key is ignored by ObservableArray #1650

Closed
Ixanin opened this issue Jul 23, 2018 · 4 comments
Closed

object with 'toString' key is ignored by ObservableArray #1650

Ixanin opened this issue Jul 23, 2018 · 4 comments
Labels

Comments

@Ixanin
Copy link

Ixanin commented Jul 23, 2018

Hi, I can't assign object with 'toString' key to observable array.

data from server
data from server

observable array
observable array

demo: https://codesandbox.io/s/1yxyzwjz14
I am using: "mobx": "^4.3.1", "mobx-react": "5.2.2",

@urugator
Copy link
Collaborator

urugator commented Jul 23, 2018

Minimal repro: https://codesandbox.io/s/pppj0njj8q
toString is defined on target object as observable prop, but it has "default descriptor" so I quess there is a call like: Object.defineProperty(target, "toString", undefined) somewhere...
EDIT: As @mayorovp pointed out it's actually Object.defineProperty(target, "toString", func) (one would expect it to throw...)

@mayorovp
Copy link
Contributor

mayorovp commented Jul 23, 2018

The bug lives here: generateObservablePropConfig

@mweststrate
Copy link
Member

Confirmed as bug (sorry for the late follow up!), investigating a solution

@mweststrate
Copy link
Member

Fix has been released as: 5.1.2 / 4.4.2

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

No branches or pull requests

4 participants