O
21

Question about my first API call that broke the whole page

Honestly, I was following a tutorial last night and tried to fetch some weather data for a little project. I put the fetch call inside the render function instead of a useEffect, and it just kept looping until my browser froze. Took me like 40 minutes and a stack overflow post to realize the mistake. Has anyone else had a dumb moment like that where the fix was basically one line?
1 comments

Log in to join the discussion

Log In
1 Comment
veram99
veram9911d ago
Moving fetch to useEffect fixed it too. Such a relief!
7