<!-- source-hash: 997ced5d3608ab71a6c62296ac741efd -->
A React hook that provides real-time window dimensions, handling both SSR compatibility and resize events. It returns the current browser window width and height, updating automatically when the window is resized.

## Key Components

- **useWindowSize**: Main hook export that tracks window dimensions
- **windowSize**: State object containing current `width` and `height`
- **isClient**: SSR safety flag to prevent hydration mismatches
- **handleResize**: Event handler that updates dimensions on window resize

## Usage Example

```typescript
import { useWindowSize } from './use-window-size'

function ResponsiveComponent() {
  const { width, height } = useWindowSize()

  return (
    <div>
      <p>Window size: {width} × {height}px</p>
      {width < 768 ? (
        <MobileLayout />
      ) : (
        <DesktopLayout />
      )}
    </div>
  )
}

// Example: Conditional rendering based on screen size
function Navigation() {
  const { width } = useWindowSize()
  const isMobile = width < 1024

  return isMobile ? <MobileNav /> : <DesktopNav />
}
```

The hook automatically handles cleanup of event listeners and provides SSR-safe initial values to prevent hydration errors in Next.js applications.