144k views
2 votes
How to call a function in react component on load.

1 Answer

1 vote

The use effect runs by default after every render of the component. When placing use effect in our component we tell React that we want to run the callback as an effect. React will run the effect after rendering and after performing the DOM update

User Jerin Joseph
by
5.6k points