Presentational and Container Components
Dan Abramov
6.8K59

First of all, Thanks Dan for Redux and for this article as well.

I suggest you to start building your app with just presentational components first. Eventually you’ll realize that you are passing too many props down the intermediate components. When you notice that some components don’t use the props they receive but merely forward them down and you have to rewire all those intermediate components any time the children need more data, it’s a good time to introduce some container components. This way you can get the data and the behavior props to the leaf components without burdening the unrelated components in the middle of the tree.

Thanks again for sharing these lines. I have been through a continuous phase of refactoring presentational and container components whole last week. Now I have gained little bit of experience in defining component type based on the requirement.
But lets say a container is just passing props to children, and it has nothing to do with app state and child listeners, its just simply rendering this.props.chiildren, does it still make sense to use it as a container component (smart component, which uses connectStateToProps)? Why not make it be a presentational component (dumb component)?

Show your support

Clapping shows how much you appreciated Shekhar Kumar’s story.