3 ms·
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 be
by markus-ipse 10y ago
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.