mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
5b0c122f5d
List of user emails GitOrigin-RevId: 28a8e405812932ba7ebd8043a4dc9d3c573a68b2
14 lines
267 B
TypeScript
14 lines
267 B
TypeScript
import { useLayoutEffect, useRef } from 'react'
|
|
|
|
export default function useIsMounted() {
|
|
const mounted = useRef(false)
|
|
|
|
useLayoutEffect(() => {
|
|
mounted.current = true
|
|
return () => {
|
|
mounted.current = false
|
|
}
|
|
}, [mounted])
|
|
|
|
return mounted
|
|
}
|