mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
24 lines
401 B
TypeScript
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}</>;
|
|
}
|