CONTAINER &
PRESENTATIONAL
Later called them
components
Slide 4
Slide 4 text
C IN
MVC = SMART
V IN
MVC = DUMB
Others have compared them to
Slide 5
Slide 5 text
How things work
No DOM markup, no styles
Provide data
Call actions
How things look
No app dependencies
Just props, for data and callbacks
Rarely have own state, only UI state
Slide 6
Slide 6 text
Separation of concern
Easier to reason about
Localize complexity
Lots simple components
UI bits more reusable
BENEFITS
Make the transition faster
Scattered props
Access to Container references
1-*
SPLIT
Slide 16
Slide 16 text
“Broad”
eg, ReportsUsersContainer -> *
1-*
SPLIT
Slide 17
Slide 17 text
No content
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
"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.”
@dan_abramov
MOAR BROAD?
Slide 20
Slide 20 text
CONTAINMENT
props.children
props.other
React.PropTypes.node
Name *Layout