I’ve created a MobX store (React Native project) and am updating a state value on button click. The state is successfully updating as displayed in a console log, but the DOM is not re-rendering with the updated state. Most answers on SO are a little outdated as they recommend adding @observable in the right places, but the latest MobX docs
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