WMG's state management is now sufficiently complex that engineers can no longer track the data flow in their heads. I think it's time to introduce RTK!
Benefits:
Most popular state management library that most React engineers know how to use and it's great for managing complex FE state.
It helps cuts down boilerplate code that we currently have in the code base from using React hooks such as useReducer directly. It is recommended to not use RTK when the state is simple, but we've now outgrown that phase
RTK already comes with Chrome extension for easy debugging
Standardized data flow means we can leverage existing Redux ecosystem and libraries to solve problems we run into in the future
Effort: Probably 3 to 4 days to set up the library and migrate existing state to use the reducer, and a day or two to test WMG thoroughly
useReducer
directly. It is recommended to not use RTK when the state is simple, but we've now outgrown that phase