fix: hydratation error with age calculation

This commit is contained in:
theoludwig committed 2024-04-06 20:32:09 +02:00
1 parent 982b148329
commit cd5e92b64a
2 files changed
+26 -6

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { useEffect, useState } from "react"
export interface UseIsMountedResult {
isMounted: boolean
}
export const useIsMounted = (): UseIsMountedResult => {
const [isMounted, setIsMounted] = useState(false)
useEffect(() => {
setIsMounted(true)
}, [])
return { isMounted }
}