The amount of material is updated every second, which makes React recalculate the DOM too many times. The context should only provide the last update timestamp and the production rate. The final amount is then only calculated locally in the component that needs it.
The amount of material is updated every second, which makes React recalculate the DOM too many times. The context should only provide the last update timestamp and the production rate. The final amount is then only calculated locally in the component that needs it.