# @types/gatsbyjs__reach-router

> TypeScript definitions for @gatsbyjs/reach-router

Latest version **2.0.5** (published 2024-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/gatsbyjs__reach-router
pnpm add @types/gatsbyjs__reach-router
yarn add @types/gatsbyjs__reach-router
bun add @types/gatsbyjs__reach-router
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2024-10-14 |
| First published | 2022-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/gatsbyjs__reach-router
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gatsbyjs__reach-router
- npm.io page: https://npm.io/package/@types/gatsbyjs__reach-router

## Dependencies (2)

- [@types/react](https://npm.io/package/@types/react.md) *
- [@types/reach__router](https://npm.io/package/@types/reach__router.md) *

## Recent versions

- 2.0.5 (latest) — 2024-10-14
- 2.0.4 (ts4.6) — 2024-01-03
- 2.0.3 (ts4.5) — 2023-11-07
- 2.0.0 (ts4.2) — 2023-02-23
- 1.3.0 (ts3.9) — 2022-04-05
- 2.0.2 — 2023-10-18
- 2.0.1 — 2023-09-20

## README

# Installation
> `npm install --save @types/gatsbyjs__reach-router`

# Summary
This package contains type definitions for @gatsbyjs/reach-router (https://github.com/gatsbyjs/reach-router#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gatsbyjs__reach-router.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gatsbyjs__reach-router/index.d.ts)
````ts
import { WindowLocation } from "@reach/router";
import * as React from "react";

export {
    AnchorProps,
    createHistory,
    createMemorySource,
    globalHistory,
    History,
    HistoryActionType,
    HistoryListener,
    HistoryLocation,
    HistorySource,
    HistoryUnsubscribe,
    HLocation,
    isRedirect,
    Link,
    LinkGetProps,
    LinkProps,
    Match,
    MatchProps,
    MatchRenderFn,
    MatchRenderProps,
    NavigateFn,
    NavigateOptions,
    Redirect,
    RedirectProps,
    RedirectRequest,
    redirectTo,
    RouteComponentProps,
    Router,
    RouterProps,
    ServerLocation,
    ServerLocationProps,
    // Looking for useNavigate? It was removed from @gatsbyjs/reach-router
    // Use import { navigate } from 'gatsby' instead
    useLocation,
    useMatch,
    useParams,
    WindowLocation,
} from "@reach/router";

import { History } from "@reach/router"; // eslint-disable-line no-duplicate-imports

// Override location to remove navigate function for React 18 server components compatibility
// https://github.com/gatsbyjs/reach-router/pull/4

export interface LocationProps {
    children: LocationProviderRenderFn;
}

export class Location extends React.Component<LocationProps> {}

export interface LocationProviderProps {
    history?: History | undefined;
    children?: React.ReactNode | LocationProviderRenderFn | undefined;
}

export type LocationProviderRenderFn = (context: LocationContext) => React.ReactNode;

export interface LocationContext {
    location: WindowLocation;
}

export class LocationProvider extends React.Component<LocationProviderProps> {}

````

### Additional Details
 * Last updated: Mon, 14 Oct 2024 10:39:56 GMT
 * Dependencies: [@types/reach__router](https://npmjs.com/package/@types/reach__router), [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Adam Jones](https://github.com/domdomegg).

---
_Source: https://npm.io/package/@types/gatsbyjs__reach-router · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
