Redux is notorious for its boilerplate and has a relatively difficult learning curve. We provided generators for some common templates but it was still one of the most challenging pieces and source of confusion while working with React Native. It is worth noting that these challenges were not React Native specific.
Has anyone used Rematch? It's an abstraction later built on top of Redux to try and account for some of its flaws. The pitch is that it's Redux (and API compatible), but with reasonable defaults and less boilerplate. I've been considering it because my interactions with Redux have been painful.
One thing that confuses me was how to implement pub/sub on a component level, while connect automatically does that for you, there are some instances where i would want to fetch the network after an event. I just ended up using componentWillReceiveProps which is really ugly.
I fully agree, but the amount of boilerplate is why I decided to go from "full stack" to solely backend. I want to spend my time on problems, not writing glue to piece the problems together.
Java is one of the worst when it comes to boilerplate.
Haha. I'm at a node shop -- there would actually be a lot of boilerplate to write if I was working on features, but right now my job is to write code that reduces boilerplate for other engineers, which is one of my favorite things to do. e.g. When someone starts writing a new route, they have a helper function that provides their error client, logger, hooks everything into our server automatically, etc. Right now it's a much more manual process.
To be fair, I think most redux tutorials out there suck and they often show you how to work with 4 other libraries at the same time. Redux itself is really really simple, it's more wrapping your head around the concepts than the code.
Amen to that. I actually think Vuex makes so much more sense than redux. Redux to me always feels insanely verbose. And then how you have to tie it together feels just as strange.
Redux makes complicated state possible to reason about. It does this at the cost of boilerplate, indirection and an awkward approach to async. I think I've only ever seen one Redux project actually justify these costs, and that was the article editing suite we wrote for reporters at The Guardian, back in 2015.
All the rest have been fairly trivial apps that could use React setState or possibly no client state at all.
That's the way I went for my most recent React apps, and only leaning on React Contexts for some stuff like user info and error handling that was needed in disparate components. I think a lot of people reach for Redux too quickly; it's definitely overkill for most projects I've seen it used in. Half the time, I'm happy to write my own state machine to do Reduxy things, just because I think Redux is over-engineering a lot of the time. That said, I won't write it off completely because I can definitely see the usecase for sufficiently complicated apps.
Redux documentation (at least 1 year ago), was very complex and pompous. They should learn from Vue.js to give a better simpler documentation. Also it is full of boilerplate BS. Happy to no longer work with React or ReactNative Bs.
149
u/GodGrabber Jun 19 '18
Amen to that.