Why do I have multiple containers in a component in redux? What's the use?

I am new to Redux and came from Reflux

in the documentation this Redux link they say "one container component at the top in Redux examples was a bug. Don't take that as a maxim" why?

for example in the "todo-example" example redux they have a lot of container for the Todo component and I may not understand the reason for this. I mean we can only have one Container and one Presentation Component for the Todo Component.

What is the advantage of using multiple containers in a component?

+3


source to share


2 answers


You might want to read my blog post Practical Redux, Part 6: Linked Lists, Forms, and Performance , which covers several related concepts for connecting multiple components.



As a quick recap, plugging in more components means that each component is interested in smaller chunks of Redux store state and will need to be reprocessed less often, so it usually performs better. This also means that each component has fewer responsibilities and should be easier to understand.

0


source


Multiple containers allow you to do simple checks and development because you create a separate module / container for each component instead of a unique container that handles all of your components.

For a very small application, one could even work with a unique containerized approach, but in the real world it would be difficult to scale the application.



An interesting article describing the use of containers:

https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0

+2


source







All Articles