Design Patterns · Junior · Question 36 of 75
What is the Container/Presentational pattern in React about?
- ✓Correct answer: The container handles data and logic, the presentational one only rendering
- 2The container renders a Docker image, the presentational one slides
- 3The container is always a class, the presentational one always a function
Explanation
Presentational components receive everything via props and are easy to reuse and test (e.g. in Storybook). Today the container role is often played by hooks, and in Next.js by server components that load data.