G
G
Gimir2020-01-26 14:17:39
React
Gimir, 2020-01-26 14:17:39

How does the useEffect hook work?

Good day! I was reading the documentation on hooks on reactjs.org and came to this example:
5e2d740227bda602153011.png
I can't understand why the HandleStatusChange function is declared in the useEffect hook , and how does this hook call it? Usually when I needed to use such a function, I declared it at the top level and called it in the hook already. How it works? The documentation does not focus on this.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question