Tech Insights· reactjs.org
You can use React hooks to simulate componentDidMount and componentWillUnmount:
React.useEffect(() => {
// componentDidMount code here
return () => {
// componentWillUnmount code here
}
}, [])Read more here: #example-using-hooks-1
Shared by
- Hooks
- React



