Overview of advanced state management solutions
In this book, we focused on simple state management solutions in React, such as useState
and contexts. However, in large-scale projects, it might make sense to use advanced state management libraries to deal with complex state. I will give an overview of some selected state management libraries here, but keep in mind that there are many more libraries out there, so feel free to check them out and decide which one fits your project best.
Recoil
Recoil is a state management library for React built by Facebook Open Source. As such, it shares many of the principles of React. It is a very simple but powerful system, where state is stored in atoms, and then derived via selectors. This allows us to, for example, store only the user input of a form in atoms, and a resulting payload in a selector, which derives its state from the atoms.
You can check out Recoil here: https://recoiljs.org/.
Jotai
Jotai takes a similar approach to...