Skip to content

danieldietrich/typed-react-router-dom

Repository files navigation

Typed React Router

This library is a type-safe verion of the DOM bindings for React Router.

It is intended to be used with TypeScript.

Installation

Using npm:

$ npm install --save typed-react-router-dom react-router-dom

Then with a module bundler like webpack, use as you would anything else:

import { TypedReactRouter } from 'typed-react-router-dom';

interface IAppRoutes {
    '/login/:name': { name: string }
    '/': {}
}

const { BrowserRouter, Route, Link } = new TypedReactRouter<IAppRoutes>();

About

A type-safe react-router plugin for TypeScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published