Files
routstr-core/ui/components/suppress-hydration-warning.tsx
T
2025-10-25 00:21:41 +02:00

24 lines
401 B
TypeScript

'use client';
import { useEffect, useState } from 'react';
interface SuppressHydrationWarningProps {
children: React.ReactNode;
}
export function SuppressHydrationWarning({
children,
}: SuppressHydrationWarningProps) {
const [isClient, setIsClient] = useState(false);
useEffect(() => {
setIsClient(true);
}, []);
if (!isClient) {
return null;
}
return <>{children}</>;
}