Better HN
topnewbestaskshowjobs
Log inSign up

markus-ipse

2 karma · joined Jan 11, 2017 (9y ago) · 1 submissions

Submissions

comment 9y ago · link · parent

Another reason for having container components inject data "mid-tree", so to speak, is to avoid having to pass your props through all the ancestor components between your data-needing component and the root component. Passing props from root to leaf components works great on small/simple applications like a Todo app, but if you have a deeply nested component hierarchy it quickly gets messy if you have to pass a bunch of props trough several components who has no interest in these props other than that a child of child of child wants the data.