79108765

Date: 2024-10-21 06:28:49
Score: 1.5
Natty:
Report link

You are calling the "api/matches" API, and as a result, both setMatchData and setMatchesLoaded are being triggered. However, since you didn’t set a dependency array, useEffect will run on every render. Because of this, your useEffect is being called infinitely, which is why console.log is also running continuously.

To fix this, you need to add a dependency array to useEffect.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: SOOHYUN YUN