Skip to content
React·Intermediate·Conceptual·1 min read

Why must a reducer be pure?

Short interview answer

The same state and action must produce the same next state without mutating inputs or causing effects. React can call rendering logic more than once, and pure reducers enable predictable testing and scheduling. Network requests and storage belong outside the reducer.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to State modeling with reducers

Related questions