useBreakpoint
The
useBreakpoint hook is used for viewport checks.
It uses a resize handler under the hood and thus only works on client-side.Do's & Don'ts
Params
Name | Type | Default | Description |
|---|---|---|---|
breakpoint* | small | medium | large | huge | The breakpoint which is checked using a mobile-first approach |
Returns
bool: Whether the breakpoint is active or not