# @types/react-router-guard

> TypeScript definitions for react-router-guard

Latest version **2.3.3** (published 2022-01-18) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.3.3 |
| Published | 2022-01-18 |
| First published | 2020-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Dependencies (5)

- [@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) *
- [@types/react-loadable](https://npm.io/package/@types/react-loadable.md) *
- [@types/react-router-dom](https://npm.io/package/@types/react-router-dom.md) *

## Recent versions

- 2.3.3 (latest) — 2022-01-18
- 2.3.2 (ts3.7) — 2021-07-08
- 2.3.0 (ts2.8) — 2020-01-02
- 2.3.1 — 2021-03-25

## README

# Installation
> `npm install --save @types/react-router-guard`

# Summary
This package contains type definitions for react-router-guard (https://github.com/laptransang/react-router-guard#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-guard.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-guard/index.d.ts)
````ts
// Type definitions for react-router-guard 2.3
// Project: https://github.com/laptransang/react-router-guard#readme
// Definitions by: TSL <https://github.com/laptransang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7

import * as React from 'react';
import * as H from 'history';

export const history: H.History;

export {
    Loadable
} from 'react-loadable';

export {
    BrowserRouter,
    Link,
    NavLink,
    Route,
    Router,
    Switch,
} from 'react-router-dom';

export {
    Redirect,
} from 'react-router';

export function lazy<T extends React.ComponentType<any>>(
    factory: () => Promise<{ default: T }>
): React.LazyExoticComponent<T>;

export interface RouterGuardConfigProps {
    path: string;
    component: React.LazyExoticComponent<any>;
    canActivate?: Array<() => Promise<any>> | undefined;
    redirect?: string | undefined;
    exact?: boolean | undefined;
    routes?: RouterGuardConfigProps[] | undefined;
}

export interface RouterGuardProps {
    config: RouterGuardConfigProps[];
    history?: H.History | undefined;
    loading?: boolean | React.ReactElement | undefined;
}

export class RouterGuard<T> extends React.Component<RouterGuardProps, any> {}

````

### Additional Details
 * Last updated: Tue, 18 Jan 2022 22:01:53 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/history](https://npmjs.com/package/@types/history), [@types/react-loadable](https://npmjs.com/package/@types/react-loadable), [@types/react-router-dom](https://npmjs.com/package/@types/react-router-dom), [@types/react-router](https://npmjs.com/package/@types/react-router)
 * Global values: none

# Credits
These definitions were written by [TSL](https://github.com/laptransang).

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