Course contentsShow
← React
Lesson 1182 of 2,39630. Composition: Inversion of ControlFree lesson

When State Reducer is Overkill

Recognizing when simpler patterns like callbacks or controlled props are more appropriate than full reducer control.

When State Reducer is Overkill

You'll learn to recognize when simpler inversion of control patterns are more appropriate than implementing a full state reducer.

The Problem with Overusing State Reducers

The state reducer pattern is powerful—it gives consumers complete control over state transitions. But that power comes with complexity: both you and your users must think in terms of actions, state change objects, and reducer composition. It's a heavy architectural pattern.

Many customization needs are much simpler. If a consumer just wants to do something when a dropdown opens, they don't need control over the entire state machine—they need a callback. If they want to prevent one specific transition, they don't need to write a reducer—they need a controlled prop.

Simpler Alternatives

Use callbacks when consumers need to react to state changes or inject side effects:

  • onToggle, onChange, onSelect etc.
  • Simple, familiar, zero learning curve

Use controlled props when consumers need to override specific state values:

  • isOpen, value, selectedIndex etc.
  • Gives surgical control without reducer complexity

Use behavior props when consumers need to customize logic conditionally:

  • disabled, closeOnSelect, allowMultiple etc.
  • Declarative, self-documenting

The Decision Framework

State reducers shine when consumers need to customize complex state transition logic—preventing certain action types conditionally, transforming state based on multiple factors, or coordinating between different state slices.

For everything else? Start simple. A callback or controlled prop is easier to document, easier to understand, and easier to maintain. Don't force your users (or yourself) to think like Redux developers unless the problem truly demands it.

Key Takeaway: Choose callbacks for reactions, controlled props for overrides, and state reducers only when consumers genuinely need to rewrite state transition logic itself.