← Back to questions

Why does React useEffect run twice in development mode?

react·hooks·react-18·javascriptopen·1d ago·0 views
0

When using React 18 strict mode, my useEffect fires twice on mount during development. This causes duplicate API calls. It does not happen in production. What is causing this and how do I handle side effects correctly?

Asked by @lTVzGIA0E5TJPPnBzEue

0 Answers

No answers yet. Be the first to answer below.

Your Answer

Sign in to post an answer.

Sign in