Skip to content Skip to sidebar Skip to footer

Rerender Component As Mobx Store Is Updated

I am using chart.js to show price changes from the backend in real time. Backend sends a new price when it is changed to frontend. priceData(array) is saved in mobx priceChartStore

Solution 1:

This is the way mobx works in react (with react-mobx)

React component class or stand-alone render function into a reactive component, which tracks which observables are used by render and automatically re-renders the component when one of these values changes.

So mobx will tracks only the variables used in the render function and cause re-render when they change.


Post a Comment for "Rerender Component As Mobx Store Is Updated"