Summary
In this chapter, we learned about a library – React Tracked. This library has two purposes. One purpose is to replace the use case of React Context. The other purpose is to enhance the selector hook provided by some other libraries, such as React Redux.
Technically, the React Tracked library is not a global state library. It's to be used with state functions, such as useState
and useReducer
, or Redux. All React Tracked provides is a feature to optimize re-renders.
In the next chapter, we will compare the three libraries for global state, namely Zustand, Jotai, and Valtio, and discuss global state patterns to wrap up this book.