Hacker News new | past | comments | ask | show | jobs | submit login

Do you mind expanding on that?

I was thinking the same thing at first, why have this monstrous global state which is against every good practice you have ever heard of.

But then, if you want to keep state when switching between pages, you need to hoist up that state to the parent component. At some point, there's going to be a component near the root that keeps a lot of state for its children, that then has to be trickled down the component tree.

If you don't need to reuse those components in a different setting, then the redux solution feels quite ergonomic.

Now, this is coming from an embedded C programmer point of view, and this is my first foray into react/redux, so I'm obviously lacking context. But we're writing a front end for our embedded device, and I have to say I am pleasantly surprised with the experience.




There's plenty of reasons to use Redux, even with the additional variety of (good!) options in the ecosystem.

You might want to watch my talk on "The State of Redux" from Reactathon 2019, where I covered some of this:

https://blog.isquaredsoftware.com/2019/03/presentation-state...

Also, note that we have a new Redux Toolkit package, which is intended to simplify many common Redux use cases, and is now our recommended approach for writing Redux logic:

https://redux-toolkit.js.org




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: