A note on strict mode. It has been stated that it is on purpose, and not a bug that it runs twice. It is to help guide people who are using useEffect incorrectly.
great, only one thing. around the 10:00 mark, you said the setter function is async? how do you mean by that? It doesn't make sense to me, because when input is added, doesnt the setter function automatically get updated with useState?
If I am not wrong, it means that the console.log() printing out the word might get executed first before setWord() is called. Thus, in the video the console log was one character behind. If the setter function is synchronous then this wouldn't happen, since only one thread is executing the code. And order of code gets executed from top to bottom.
⚛ FREE React Course (download & bonus content) - calcur.tech/free-react-course
React UA-cam Playlist - calcur.tech/react-playlist
Code - github.com/CalebCurry/react
This is one of the most informative videos on useEffect I've watched. Thanks Caleb!
Thank you Caleb. Great Tutorial
True: got confused, did a little search on the subject and now I am here :)))
A note on strict mode. It has been stated that it is on purpose, and not a bug that it runs twice. It is to help guide people who are using useEffect incorrectly.
I love your videos! Without your channel, I don't think I could get through my classes. And you always make me laugh! Love your jokes
u funny bro
😆
great, only one thing. around the 10:00 mark, you said the setter function is async? how do you mean by that? It doesn't make sense to me, because when input is added, doesnt the setter function automatically get updated with useState?
If I am not wrong, it means that the console.log() printing out the word might get executed first before setWord() is called. Thus, in the video the console log was one character behind.
If the setter function is synchronous then this wouldn't happen, since only one thread is executing the code. And order of code gets executed from top to bottom.