Question Bank

React Stateful vs Stateless Components: Two Explanations Quiz

Difficulty: Easy

Two explanations of the stateful/stateless (smart vs presentational) split, plus companions on hooks-era state in function components and on testability trade-offs.

Question Bank
/

React Stateful vs Stateless Components: Two Explanations Quiz

React Stateful vs Stateless Components: Two Explanations Quiz

Two explanations of the stateful/stateless (smart vs presentational) split, plus companions on hooks-era state in function components and on testability trade-offs.

Question Bank
Easy
JavaScript
4 questions
quiz
react
interview-prep
fundamentals

929 views

22

Define a stateful (smart) component and a stateless (presentational) component, and explain why this split is a useful design boundary even in a hooks-only codebase.

Examples

Example 1:

Input: a component that owns a counter value and renders the count plus +/- buttons
Output: stateful (smart): it owns state and behavior.
Explanation: this component holds the counter in useState and decides how the user interactions mutate it.

Example 2:

Input: a component that takes `count` and `onIncrement` as props and renders them
Output: stateless (presentational): no state, no behavior of its own, easy to reuse.
Explanation: it is a pure function of its props; render-only.