I am a frontend developer, sharing my learnings and Jounrey
Nothing here yet.
useEffect(function , dependency) It is a callback function which is executed after another function has finished the execution callback is executed right after changes were being pushed to DOM. without using the useEffect we can get output as 'after 2 sec' from the count value. In useEffect we setCount value as 'Hello world' , i.e only after the executed of the callback function ('after 2 sec) the DOM changes and got updated to ('Hello world') i.e the function got updated from ('after 2 sec') to ('Hello world') right after excution of first state value and then setState value get change and update to DOM.