fn
useWindowFocus
v0.0.15testeddemoReactively track whether the window is focused via `focus`/`blur` events.
Example
ts
const focused = useWindowFocus();Demo
Loading demo…
Signature
ts
export function useWindowFocus(options: UseWindowFocusOptions ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
options? | UseWindowFocusOptions | Options |
Returns
UseWindowFocusReturnA shallow ref that is `true` while the window has focus