3 ms·
I was forced to migrate from pure native development to React Native and Redux is one of the stupidest things I ever witnessed. Or at least the way the previous
by puelocesar 2mo ago
I was forced to migrate from pure native development to React Native and Redux is one of the stupidest things I ever witnessed. Or at least the way the previous devs setup that thing, because it’s so easy to make costly mistakes with it.
I lost so many days of my life profiling and debugging to figure out why hundreds of components were re-rendering when a tiny thing changed somewhere completely unrelated
- tcfhgj 2mo ago> figure out why hundreds of components were re-rendering when a tiny thing changed somewhere completely unrelated Could you explain how this comes from React Native and/or redux? I have used Angular with redux (ngrx) and redux made it quite obvious what changed what and why
- user43928 2mo agoRedux is great and it solves exactly that problem. You create a selector. You use the selector in a React component. The component re-renders when the selector outputs a different value, with the usual reference equality caveat. Does it get any simpler than that? However, yes, I have seen most developers use Redux incompetently. They would use actions like "setOrder" instead of "itemAdded", defeating the purpose of a state machine from the start.
- satvikpendem 2mo agoThey might have been using Redux before it did a major API change in the form of slices.
- user43928 2mo agoThat would be about 7 years ago, when Redux Toolkit released in 2019.
- satvikpendem 2mo agoThat's probably right. Lots of people migrated from Redux onto other state management libraries.
- Degorath 2mo agoThere's simply a ton of teams that also never updated. My previous team was not using RTK and our redux setup was extremely confusing to me (a backend engineer).