State Management · Junior · Question 10 of 75

What must a reducer function be like?

Explanation

React may call the reducer more than once (e.g. in Strict Mode), so it must not make requests, set timers or mutate the state. Side effects belong in event handlers or effects.

Further reading

Problem with a question

State Management · Junior · question 10

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz