r/learnreactjs • u/funkenpedro • Nov 07 '22
newb useEffect question
I'm trying to figure out what useEffect does. The tutorial says something like useEffect is a summation of componentDidMount and componentDidUpdate.
So does that mean whatever function I pass to useEffect will be executed whenever the state of the component is updated or initialized?
Edit: While I'm at: useState is essentially a means of adding state to react functional component.
Is there anything I should add to this description to make it complete?
1
Upvotes
View all comments
Show parent comment
1
u/funkenpedro Nov 08 '22
Classes are dead. Long live classes. I was just getting my head around them.