mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
12 lines
271 B
TypeScript
12 lines
271 B
TypeScript
import { useEffect, useState } from 'react';
|
|
|
|
export const ClientOnly = async ({ children }: { children: React.ReactNode }) => {
|
|
const [mounted, setMounted] = useState(false);
|
|
|
|
useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
|
|
return mounted ? children : null;
|
|
};
|