Funny! I encountered the same re-rendering issue while making a fetch call outside of a useEffect hook recently, I went ahead throwing the memo function in the component, but that didn't solve the re-rendering issue.
Then after some time, I noticed the fetch call was outside a useEffect hook ๐, what a bug I spent some time trying to figure out what was wrong.
Favourite Jome
QA Engineer @bug0
Wonderfully explain David!
Funny! I encountered the same re-rendering issue while making a fetch call outside of a useEffect hook recently, I went ahead throwing the memo function in the component, but that didn't solve the re-rendering issue.
Then after some time, I noticed the fetch call was outside a useEffect hook ๐, what a bug I spent some time trying to figure out what was wrong.
Thanks for sharing!