I fetch data from my backend and test it by using console.log. I don’t know why the console.log gets executed two times as it shows in my Chrome console?
FYI, I use isLoaded as a flag to determine whether State has been set.
Thanks for any opinions.
I suspect it is an issue with the way most online editors render. That being said, if you are hosting locally, and rendering using something like create-react-app, then I am not sure why your component would be rendered twice.