DEV Community

Discussion on: Setting up redux is difficult

Collapse
 
stereoplegic profile image
Mike Bybee • Edited

Check out the official Redux Toolkit or easy-peasy to reduce the need for boilerplate.

And there's always the option of not using Redux. Constate, Zustand, react-tracked, or just plain context (make sure you're colocating context providers, not just doing it all top level, and/or using something like @dai_shi 's implementation of useContextSelector) and hooks can be excellent state management solutions. You'll still need to implement persistence, but there are even solutions out there to use Redux middleware (such as redux-persist) with e.g. useReducer.

While many are now saying that remote state should only be thought of as cache in the frontend app, it's also entirely possible to use something like Firebase, AWS AppSync, Apollo, or the excellent RxDB (wrapper around RxJS and PouchDB, with optional GraphQL sync via two simple mutations, rather than the CouchDB replication protocol) as state management solutions with persistence and sync built in.