The observer HoC automatically subscribes React components to any observables that are used during rendering. As a result, components will automatically re-render when relevant observables change. It also makes sure that components don’t re-render when there are no relevant changes.
Read moreIs MobX only for React?
While MobX works independently from React , they are most commonly used together. In The gist of MobX you have already seen the most important part of this integration: the observer HoC that you can wrap around a React component.
Read moreWhat is the difference between MobX and Redux?
In Mobx, a lot of built-in abstraction is there, which leads to less code. In Redux, there is less abstraction and a need to write more code . Mobx is mainly used to develop the application fast and in less time. Redux developed applications generally take time because of their complexity.
Read moreWhat are MobX actions?
An action is any piece of code that modifies the state. In principle, actions always happen in response to an event. For example, a button was clicked, some input changed, a websocket message arrived, etc. MobX requires that you declare your actions , although makeAutoObservable can automate much of this job.
Read more