Skip to content

Latest commit

 

History

History
executable file
·
73 lines (42 loc) · 3.41 KB

File metadata and controls

executable file
·
73 lines (42 loc) · 3.41 KB

Return to Home


Student Resources

Table of Contents

Terminology & Links

  1. ES6
  2. React

Audio Resources

  1. Podcasts

ES6

Back to top

REACT

Back to top

Presentational and Container Components This article written by Dan Abramov (Redux Author, React Core Contributor, Create React App Core Contributor).

He describes the pattern of separating components into "container" and "presentational" components. In a nutshell, this can be explained as follows:

  • Container components are primarily concerned with how things work and render very little, if any of their own markup. Instead they mostly render other components and pass down the logic and data they need to work.

  • Presentational components are concerned with how things look and typically don't contain any logic that doesn't have to do with their own individual UI.

  • This pattern helps us build components with little to no coupling that can more easily be reused in different parts of app or even across applications. It also lets us stub out our applications appearance by writing presentational components first, and then writing container components once we're ready to make things work.

The most important takeaway should be that there should be a few of these "container" components which act as the "brain" for their children.