mirror of
https://github.com/System-End/site.git
synced 2026-04-19 16:28:21 +00:00
12 lines
304 B
JavaScript
12 lines
304 B
JavaScript
// Full credit to https://joshwcomeau.com/snippets/react-hooks/use-has-mounted
|
|
import React from 'react'
|
|
|
|
function useHasMounted() {
|
|
const [hasMounted, setHasMounted] = React.useState(false)
|
|
React.useEffect(() => {
|
|
setHasMounted(true)
|
|
}, [])
|
|
return hasMounted
|
|
}
|
|
|
|
export default useHasMounted
|