Connected: {gamepad.gamepads.length}
Active: {String(gamepad.active)}
First: {first ? first.id : "none"}
);
};
```
#### Notes
- Hook uses the [navigator.getGamepads API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getGamepads).
#### Type Declarations
```ts
export interface UseGamepadStateReturn {
active: boolean;
gamepads: Gamepad[];
supported: boolean;
}
export declare const useGamepad: () => UseGamepadStateReturn;
```
### 5.21 useGeolocation
Returns the current geolocation and updates on changes.
#### Usage
```ts
import { useGeolocation } from "@siberiacancode/reactuse";
const geolocation = useGeolocation();
```
#### Example
```tsx
import { useGeolocation } from "@siberiacancode/reactuse";
export const Location = () => {
const geolocation = useGeolocation();
if (geolocation.loading) return Locating...
;
if (geolocation.error) return