reading-notes

Reading notes about code for my future reference.

View the Project on GitHub

Reading: Component Lifecycle / useEffect Hook

What purpose does useEffect serve in a function component compared to its counterpart(s) in class components?

The useEffect method is used as hook to serve as a way to apply lifecycle methods.

When using the useEffect Hook:

It allows you to use state and other react features without having to utilize react features without writing class.

What does useEffect do?

After rendering finishes, useEffect will check the list of dependency values against the values from the last render, and will call your effect function if any one of them has changed.

Why is useEffect called inside a component?

It allows us to access the count state variable from the effect.