Run useEffect Only Once

added by JavaScript Kicks
7/30/2019 3:20:27 PM

188 Views

React has a built-in hook called useEffect. Hooks are used in function components. The Class component comparison to useEffect are the methods componentDidMount, componentDidUpdate, and componentWillUnmount. useEffect will run when the component renders, which might be more times than you think.


0 comments