Skip to content

Tag: mobx

Mobx’s observable loses child objects equality

When I create an observable from plain object which contains fields that are effectively same objects, this property are not equal objects anymore. So if I change one’s property, the second stay untouched. Is there a proper way to handle this? https://codesandbox.io/s/mobx-equality-demo-5eowk Answer Whe…

How to get a plain object from mobx object?

I defined a mobx map as below: then I added object on the editors as below: when I get the object from editor as below: the returned object myEditor has some builtin functions such as: I wander how I can get a plain javascript object from editor? Answer You can use toJS. Example