Introduction
Returns true after the component has mounted. Helps avoid hydration mismatches when client-only APIs (charts, maps, random IDs) must not run on the server.
Platform: React 18+ (web). Dependencies: react only.
Hook
Example
tsx
const mounted = useMounted();if (!mounted) return null;return <ClientOnlyChart data={data} />;
Footer
Prefer rendering a static placeholder on the server instead of null when SEO or layout stability matters.