Initial commit

This commit is contained in:
Igor Martyniuk
2026-06-25 15:53:49 +03:00
commit 1bb0b7e68a
1517 changed files with 218469 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# useMounted
Returns `true` after the component has mounted on the client. Useful for deferring client-only rendering to avoid SSR hydration mismatches.
## Signature
```ts
function useMounted(): boolean;
```
## Usage
```tsx
function ThemeToggle() {
const mounted = useMounted();
if (!mounted) return null; // avoid SSR/hydration mismatch
return <button>{getCurrentTheme()}</button>;
}
```
## Notes
- Always returns `false` on the first render (SSR and initial client render), then `true` after `useEffect` fires.
- Client-only (`'use client'`).