mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
16 lines
360 B
TypeScript
16 lines
360 B
TypeScript
"use client"
|
|||
|
|
|
||
|
|
import {useEffect, useState} from "react"
|
||
|
|
|
||
|
|
const HydrationZustand = ({children}) => {
|
||
|
|
const [isHydrated, setIsHydrated] = useState(false)
|
||
|
|
|
||
|
|
// Wait till Next.js rehydration completes
|
||
|
|
useEffect(() => {
|
||
|
|
setIsHydrated(true)
|
||
|
|
}, [])
|
||
|
|
|
||
|
|
return <>{isHydrated ? <div>{children}</div> : null}</>
|
||
|
|
}
|
||
|
|
|
||
|
|
export default HydrationZustand
|