Skip to content
Advertisement

Tag: mobx-react

MobX – Why should I use `observer` when I could use `inject` when injecting data into a React component

MobX documentation suggests I should use observer on all my components. However by using inject I get more fine grained control over what data causes a re-rendering of my components. My understanding is I that with observer, a change in all accessed observables in the last render will cause a re-render, even if the observable is nested deep in the

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

Advertisement