mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-10-11 17:06:21 +02:00
perf!: monorepo setup + fully static + webp images
BREAKING CHANGE: minimum supported Node.js >= 22.0.0 and pnpm >= 9.5.0
This commit is contained in:
15
packages/react-hooks/src/useIsMounted.ts
Normal file
15
packages/react-hooks/src/useIsMounted.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export interface UseIsMountedOutput {
|
||||
isMounted: boolean
|
||||
}
|
||||
|
||||
export const useIsMounted = (): UseIsMountedOutput => {
|
||||
const [isMounted, setIsMounted] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true)
|
||||
}, [])
|
||||
|
||||
return { isMounted }
|
||||
}
|
Reference in New Issue
Block a user