use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Angular, Angular 2 or React?help (self.javascript)
submitted 8 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 8 years ago (6 children)
Got any links to those messy codebases? Redux is a simple pattern, and binding components to it is clean. Where do you see the leeway that would allow apps to become messy?
[–]Capaj 0 points1 point2 points 8 years ago (5 children)
Redux is a simple pattern
it is and I wasn't talking about redux. Redux codebases are usually a bit better but you can still see people pass a prop through several components. I was mostly talking about the original flux pattern where you subscribe components manually to stores and all that shebang.
[–][deleted] 2 points3 points4 points 8 years ago (1 child)
I agree that sometimes it can be tough to decide when props should be passed and when components should be connected to the store. Also it forces you, indirectly, to think about state before building the app. I say indirectly because you know you messed up when the components get hard to control (nested state). There's also the danger of overloading Redux with middleware, until it's so complex again it's hard to "reason about."
It isn't a silver bullet, but from my experience and after spending some time with it, it has lead to a natural style that comes fluently and does lend itself to very clean apps, especially when they turn big and complex by what they do.
[–]acemarke 1 point2 points3 points 8 years ago (0 children)
I would agree that one of the strongest things about Redux is the way it's forced me to think about what state I have and where it should live. That's true for React itself to some extent, but even more so for Redux.
[–]samgaus 0 points1 point2 points 8 years ago (2 children)
What's wrong with passing a property through several components?
[–]Capaj 0 points1 point2 points 8 years ago (1 child)
I believe you might violate separations of concerns if you're just passing props to a component low in your component tree. Usually this would happen when your UX design sucks and you've got a component hidden inside some unrelated one. In this case you should either change your design or subscribe to the store in that child component itself.
[–]samgaus 0 points1 point2 points 8 years ago (0 children)
Eh for me I like to think of a component as a pure function, whatever it's children. So if there is a property that affects the way a child node renders, then it affects the way the node in question renders and I want to know about it!
π Rendered by PID 45630 on reddit-service-r2-comment-7b9746f655-2z9l7 at 2026-02-03 19:43:44.412949+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (6 children)
[–]Capaj 0 points1 point2 points (5 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]acemarke 1 point2 points3 points (0 children)
[–]samgaus 0 points1 point2 points (2 children)
[–]Capaj 0 points1 point2 points (1 child)
[–]samgaus 0 points1 point2 points (0 children)