What is the difference between a Presentational component and a Container component?

Technology CommunityCategory: ReactWhat is the difference between a Presentational component and a Container component?
VietMX Staff asked 3 years ago
  • Presentational components are concerned with how things look. They generally receive data and callbacks exclusively via props. These components rarely have their own state, but when they do it generally concerns UI state, as opposed to data state.
  • Container components are more concerned with how things work. These components provide the data and behavior to presentational or other container components. They call Flux actions and provide these as callbacks to the presentational components. They are also often stateful as they serve as data sources.