Chapter 10: Use Case Scenario 4 – React Tracked
React Tracked (https://react-tracked.js.org) is a library for state usage tracking that optimizes re-renders automatically based on property access. It provides the same functionality to eliminate extra re-renders as Valtio, which we discussed in Chapter 9, Use Case Scenario 3 – Valtio.
React Tracked can be used with other state management libraries. The primary use case is useState
or useReducer
, but it can also be used with Redux (https://redux.js.org), Zustand (discussed in Chapter 7, Use Case Scenario 1 – Zustand), and other similar libraries.
In this chapter, we will again discuss optimizing re-renders with state usage tracking and compare related libraries. We will learn two usages of React Tracked, one with useState
and the other with React Redux (https://react-redux.js.org). We will wrap up with a look at how React Tracked will work with the future version of React.
In this chapter, we will cover...