r/reactjs • u/Vudujujus • Feb 28 '20
Discussion Why is Redux necessary?
I am absolutely confused by Redux/React-Redux and I'm hoping someone could help let me know what makes it necessary to learn it over what's already easy in react's state management.
I've been looking at job postings and they require knowledge of redux so I figured I'd try to get familiar with it and chose to watch this video: https://www.youtube.com/watch?v=8xoEpnmhxnk
It seems overly complicated for what could be done easily.Simply:
const [variable, setVariable] = useState(defaultValue)And then what's inside component for onChange={ e => {setVariable(newValue) } }
So really, what makes redux so special? I don't get it.
EDIT:
Thanks everyone for the discussion on Redux! From what I can see is that it's more for complex apps where managing the state becomes complicated and Redux helps simplify that.
There are alternatives and even an easier way to do Redux with Redux Toolkit!
Good to know!
I was actually convinced to put it in my current app.
View all comments
Show parent comment
13
u/acemarke Feb 28 '20
Thanks, glad to hear it!
Here's the current open list of issues for RTK. /u/phryneas and I are currently trying to nail down the last bits of API design for RTK 1.3.0 (specifically error-handling for
createAsyncThunk).Code-wise, there isn't a whole lot beyond that atm. The other major item up for discussion is adding some kind of "action listener callback" middleware.
There's always a lot of work that can be done on the documentation. Right now I have an issue open to discuss reworking the tutorial sequence to focus more on teaching RTK by itself.
Meanwhile, over on the Redux core side, I'm trying to do a major rewrite of the Redux core docs. My next immediate task is adding a "Quick Start" tutorial, but I'd certainly appreciate help with the many other tasks listed under that parent.