mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 06:01:54 +00:00
ec3400c7cd
GitOrigin-RevId: 4ece1381fbfbed048fe46a399a60e9aab2f3526e
13 lines
235 B
JavaScript
13 lines
235 B
JavaScript
import { useEffect, useRef } from 'react'
|
|
|
|
export default function useIsMounted() {
|
|
const isMounted = useRef(true)
|
|
|
|
useEffect(() => {
|
|
return () => {
|
|
isMounted.current = false
|
|
}
|
|
}, [isMounted])
|
|
|
|
return isMounted
|
|
}
|