tldraw/hooks/useLoadOnMount.ts
2021-05-17 22:27:18 +01:00

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")
}
}, [])
}