React · Junior · Question 34 of 75

Why does <StrictMode> call render and effects twice in development?

Explanation

The double call helps find side effects during render (mutations, requests) and missing cleanup in effects. It doesn't happen in the production build. If the double call breaks something, the code has a bug that will show up later anyway.

Further reading

Problem with a question

React · Junior · question 34

Test yourself

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

Take this quiz