Hacker News new | ask | show | jobs
by wwww4all 1949 days ago
Have you tried redux toolkit? createSlices?

Redux has greatly improved workflow for integrating with React. The main issue with Redux is that it pretends to be generalized state management engine, with all the overhead, while it’s in a shotgun wedding with React.

Will React team attempts another state management, aka Flux, when Redux does 95% of features and is slowly being absorbed into React eco system anyway?

Gatsby/nextjs will likely merge into a single React static site generator. Similar to React router and Reach router merger.

React is like jquery, it’s going to be around forever. React is almost at the core web infrastructure tech level, just by consensus alone.

1 comments

Not sure what you mean by the "pretends" statement.

Both the Redux core and Redux Toolkit _are_ completely UI-agnostic, and can be used with _any_ UI layer or even standalone.

Yes, most Redux usage is with React, and we do orient our docs around the assumption that you're probably using Redux and React together, but there's many people who are using Redux separately.

The “pretends” comment is light hearted joke (or is it?) about keeping Redux UI library agnostic. When we all know React is the 8000 pound gorilla pulling on Redux.

The default assumption for any production React application is that it will need Redux at some point. It’s much more efficient to start the React project with Redux, than trying to bolt on Redux after React project is underway after a while. Redux Toolkit does make things bit easier.

It’s like how React pretends that JSX is optional, when we all know JSX is requirement in React projects.

Thanks for all the work on Redux and Redux Toolkit.

Fair enough :)

Yeah, as I've been redoing our docs, I've really tried to emphasize the "take some time to decide if you _really_ need Redux" aspect:

https://redux.js.org/tutorials/essentials/part-1-overview-co...

FWIW, we do take the "UI-agnostic" part seriously. We've got an upcoming new API for Redux Toolkit that we've dubbed "RTK Query", currently available as a preview release. We've got an example of it working with Svelte, and I know I saw someone else trying it out with Vue:

https://rtk-query-docs.netlify.app/examples/svelte