11 lines
216 B
TypeScript
11 lines
216 B
TypeScript
import { useEffect } from "react"
|
|
import state from "state"
|
|
|
|
export default function useLoadOnMount() {
|
|
useEffect(() => {
|
|
state.send("MOUNTED")
|
|
return () => {
|
|
state.send("UNMOUNTED")
|
|
}
|
|
}, [])
|
|
}
|