3 ms·
I appreciate the author's work to explain this, and I like starting without Redux as a demonstration - definitely a good idea to figure out what React does on i
by sailfast 9y ago
I appreciate the author's work to explain this, and I like starting without Redux as a demonstration - definitely a good idea to figure out what React does on its own first.
That said, I found the reverse approach to Redux to be more confusing than the actual Redux documentation and the tutorials that Dan Abramov has already put together around Redux which explains things quite lucidly.
Example: https://egghead.io/lessons/react-redux-the-single-immutable-state-tree https://egghead.io/lessons/react-redux-the-single-immutable-...
- dceddia 9y agoFirst - thanks :) Second - it's interesting you found the reverse approach to be confusing. I've heard from multiple people that loved it and said it made more sense to them that way. Different strokes and all that! How experienced were you as a dev before you read the Redux docs + Dan's tutorials? I ask because I learned with those too, and they made sense to me (Dan's egghead videos were eye-opening), and I've been doing software for > 10 years professionally... but my suspicion is most beginners don't do as well with the top-down approach.
- sailfast 9y agoHi there and thanks for the response. Certainly not a beginner - been working in the field awhile and I'd worked previously with app frameworks like Angular and a written a number of other less "frameworky" apps before that. Could be an indicator as you mention :) The thing I found so compelling about Redux was thinking about state being immutable unless you took the original state {...} and changed with a reducer, which was called depending on the action you want to take. At that point, when something is changed, the whole app is changed - it's the one thing to rule them all. If you want to change something, you need to take action. "How do you change state?" "Take an action." Without understanding that flow up front it was hard to determine _why_ one would need to do things like connect, createStore, etc and how state magically got to be a prop. I think your walk-through does a great job of explaining things step by step starting from the react code (and what Redux replaces) and I can see it working well for a number of learning styles. I also really like the pancake syrup provider imagery.
- acemarke 9y agoDan's teaching style is very much "from first principles". You can see that in his Egghead videos, as well as the "Middleware" page in the Redux docs [0]. I've seen feedback that Dan's teaching style is the greatest thing ever, and feedback that it requires a giant leap of faith that "we write thing A, and thing B, and thing C, and magically they all work together at the end". Clearly, different people have different learning styles. Dan and Andrew _did_ try to write the docs in a way that would be accessible for people with varying backgrounds, but it's tough to write docs in a way that works for everyone. If you or anyone else has suggestions for improving the docs, please let me know! I'm always open to ideas for improvements. Please ping me on Twitter at @acemarke, or file an issue / PR in the repo. [0] https://redux.js.org/docs/advanced/Middleware.html https://redux.js.org/docs/advanced/Middleware.html [1] https://github.com/reactjs/redux/pull/140#issuecomment-113716381 https://github.com/reactjs/redux/pull/140#issuecomment-11371... [2] https://twitter.com/dan_abramov/status/622568094939090944 https://twitter.com/dan_abramov/status/622568094939090944
- sailfast 9y agoYeah - I can see that. "It's all functions so it all works" haha. I think the context setter that helped for me was to see "hey here's what I see with state, and here's how I think about it and did the thing" at React EU: https://www.youtube.com/watch?v=xsSnOQynTHs https://www.youtube.com/watch?v=xsSnOQynTHs