UNPKG

rwsdk

Version:

Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime

9 lines (8 loc) 251 B
import { useEffect, useState } from "react"; export const ClientOnly = ({ children }) => { const [didUpdate, setDidUpdate] = useState(false); useEffect(() => { setDidUpdate(true); }, []); return didUpdate ? children : null; };