E
E
Egor Babintsev2020-03-06 12:49:55
React
Egor Babintsev, 2020-03-06 12:49:55

How to correctly determine which component to make a container?

I'm making a simple todo app. I am using redux for task management and display filter. The component structure is as follows

  • Todo (container)
    • TodoCreator (a form for creating tasks)
    • TodoList (which in turn renders TodoItems from the todo list)
    • TodoFooter (displays the total number of tasks and filter toggle buttons)



I end up having to pass a bunch of props down, from Todo to TodoItem, for example. All of them constantly have to be validated through PropTypes, which results in an additional bunch of code. Is it possible to make 3 containers, for example, so that you have to transfer information through props to a maximum level down, or is the game not worth the candle?
PS I'm just starting to understand Redux, so many things are not obvious to me yet. Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McBernar, 2020-03-06
@McBernar

What's stopping you from taking props from redax directly? This is the meaning of redux - one state for several components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question