onUpdate
in Reactjs hooks:
import { useEffect } from "react"
function App() {
useEffect(() => {
// on mount
return () => {
// call if component update
}
})
return <div>App</div>
}
onUnmount
in Reactjs hooks:
import { useEffect } from "react"
function App() {
useEffect(() => {
// on mount
return () => {
// call if component unmount
}
}, [])
return <div>App</div>
}