Answer the question
In order to leave comments, you need to log in
Components and containers, which is better to propp or produce more containers?
Hello.
For myself, I determined the strategy of using pure react components and containers that link the redux state.
As a result, when developing the application, it turns out that I can group several components in one container, which, in turn, can use simpler components, which essentially returns to the situation with dropping callbacks into simpler child components from above. Everything would be fine, but I began to think that this is not the best option in my opinion and it’s worth changing the architecture from (component1, component2 ... componentH) -> container1 -> layer1 to (component1 -> container1) before it’s too late, (component2 -> container2) (componentH -> containerH) -> layer1 (where all containers are already grouped)
What worries me is that I’m already doing component should update optimization and forcing components to re-render only when it’s really needed, and will it be a plus if I use significantly more connections to the store through containers. Will there be pros or cons to this?
My question is very subjective, the terms may not correspond to their documentary correspondence, I am ready to detail the information for those who can help with practical advice.
Thanks in advance to those involved.
Answer the question
In order to leave comments, you need to log in
at one time I also asked this question - most of the tutorials give an example similar to what you described, it works fine on todolist but in a real project it turns into a container that throws 20-30 props
redux uses context, that is, from a larger number of connect you are nothing you won't lose
In fact, everything is simple: everything that should simply display data (any inputs also apply to this) - we take it out into components, everything that should receive, change data - we take it out into containers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question