useState hook: • React 18 useState in 60 seconds
UseEffect is the second most used React hook right after useState. It triggers some kind of logic passed in by the developer every time one of the dependencies are changed. If no dependencies are passed in, it trigger the logic only once when the app is first loaded.