#Redux v. Remix

1 messages · Page 1 of 1 (latest)

silver merlin
#

I dont even think you can compare those two, they are completely different thing.

potent ravine
#

If anything, you could compare the data fetching (and especially caching) capabilities of Redux with those of Remix

And even then, you are not even comparing Remix with Redux but rather with RTK Query. As the docs state:

Over the last couple years, the React community has come to realize that "data fetching and caching" is really a different set of concerns than "state management". While you can use a state management library like Redux to cache data, the use cases are different enough that it's worth using tools that are purpose-built for the data fetching use case.
https://redux-toolkit.js.org/rtk-query/overview

I'm not familiar enough with RTK Query. It seems to be doing roughly the same as TanStack Query
https://tanstack.com/query/v4/

Now, you typically don't need any of these libs in a Remix app and simply use loaders/actions instead. In some rather rare cases you might want to build parts of your app with something like React Query or some other client-side caching lib when you really need their individual features, and only then.

Redux itself (for anything but data fetching/caching) is still a valid choice I think, especially since the docs of Redux Toolkit are very thorough
https://redux-toolkit.js.org/

It's just that very few apps really need this sort action/reducer-style library. If you need to handle complex client state I feel like xstate is the sensible choice
https://xstate.js.org/

If all that you need is some simple global store-thing, zustand is a more light-weight and sufficient solution
https://docs.pmnd.rs/zustand/getting-started/introduction

If it's even simpler than that and you basically only want a global setState, jotai will be enough
https://jotai.org/

But most importantly: you don't want to use any of that in favor of Remix if at the end you only want to do a fetch