tldraw/hooks/useLoadOnMount.ts

12 lines
216 B
TypeScript
Raw Normal View History

import { useEffect } from "react"
import state from "state"
export default function useLoadOnMount() {
useEffect(() => {
state.send("MOUNTED")
2021-05-17 21:27:18 +00:00
return () => {
state.send("UNMOUNTED")
}
}, [])
}