# @types/react-router-config

> TypeScript definitions for react-router-config

Latest version **5.0.11** (published 2023-12-06) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 45/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.0.11 |
| Published | 2023-12-06 |
| First published | 2017-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

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

## Dependencies (3)

- [@types/react](https://npm.io/package/@types/react.md) *
- [@types/history](https://npm.io/package/@types/history.md) ^4.7.11
- [@types/react-router](https://npm.io/package/@types/react-router.md) ^5.1.0

## Recent versions

- 5.0.11 (latest) — 2023-12-06
- 5.0.10 (ts4.5) — 2023-11-07
- 5.0.7 (ts4.3) — 2023-04-05
- 5.0.6 (ts3.8) — 2022-01-18
- 5.0.3 (ts3.6) — 2021-07-07
- 5.0.2 (ts3.3) — 2020-12-19
- 5.0.1 (ts2.8) — 2019-09-23
- 1.0.6 (ts2.6) — 2018-02-12
- 1.0.5 (ts2.4) — 2017-11-27
- 1.0.4 (ts2.3) — 2017-09-26
- 1.0.1 (ts2.2) — 2017-03-30
- 5.0.9 — 2023-10-18
- 5.0.8 — 2023-09-27
- 5.0.5 — 2022-01-11
- 5.0.4 — 2021-12-24
- … 11 more at https://npm.io/package/@types/react-router-config/versions

## README

# Installation
> `npm install --save @types/react-router-config`

# Summary
This package contains type definitions for react-router-config (https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-config.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-config/index.d.ts)
````ts
import { Location } from "history";
import * as React from "react";
import { match, RouteComponentProps, SwitchProps } from "react-router";

export interface RouteConfigComponentProps<Params extends { [K in keyof Params]?: string } = {}>
    extends RouteComponentProps<Params>
{
    route?: RouteConfig | undefined;
}

export interface RouteConfig {
    key?: React.Key | undefined;
    location?: Location | undefined;
    component?: React.ComponentType<RouteConfigComponentProps<any>> | React.ComponentType | undefined;
    path?: string | string[] | undefined;
    exact?: boolean | undefined;
    strict?: boolean | undefined;
    routes?: RouteConfig[] | undefined;
    render?: ((props: RouteConfigComponentProps<any>) => React.ReactNode) | undefined;
    [propName: string]: any;
}

export interface MatchedRoute<
    Params extends { [K in keyof Params]?: string },
    TRouteConfig extends RouteConfig = RouteConfig,
> {
    route: TRouteConfig;
    match: match<Params>;
}

export function matchRoutes<
    Params extends { [K in keyof Params]?: string },
    TRouteConfig extends RouteConfig = RouteConfig,
>(routes: TRouteConfig[], pathname: string): Array<MatchedRoute<Params, TRouteConfig>>;

export function renderRoutes(
    routes: RouteConfig[] | undefined,
    extraProps?: any,
    switchProps?: SwitchProps,
): React.JSX.Element;

````

### Additional Details
 * Last updated: Wed, 06 Dec 2023 06:36:35 GMT
 * Dependencies: [@types/history](https://npmjs.com/package/@types/history), [@types/react](https://npmjs.com/package/@types/react), [@types/react-router](https://npmjs.com/package/@types/react-router)

# Credits
These definitions were written by [John Reilly](https://github.com/johnnyreilly), and [Mathieu TUDISCO](https://github.com/mathieutu).

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