3 ms·
Came here for this. When the author made me realize that a lot of our global state is just a client side cache of our server side state and we can apply a long
by gpspake 6y ago
Came here for this. When the author made me realize that a lot of our global state is just a client side cache of our server side state and we can apply a longstanding http caching standard (SWR) to manage it, it was as big of an aha moment for me as when I was originally introduced to redux.
Speaking of redux, I'm a huge fan but React ships with a useReducer hook now - thanks in no small part, I'm sure, to the author of redux working on the react core team.
These days, I'm all about reactQuery + react's native useReducer via the hooks and context api. described beautifully by Kent Dodds here: https://kentcdodds.com/blog/how-to-use-react-context-effectively#typescript--flow https://kentcdodds.com/blog/how-to-use-react-context-effecti...
I feel like these state management libraries have largely served their purpose in establishing some agreed upon conventions that are now just baked in to React and other libs.