1npm install react-router-dom @types/react-router-dom
2
3# Yarn
4yarn add react-router-dom @types/react-router-dom
1export interface RouteComponentProps<Params extends { [K in keyof Params]?: string } = {}, C extends StaticContext = StaticContext, S = H.LocationState> {
2 history: H.History;
3 location: H.Location<S>;
4 match: match<Params>;
5 staticContext?: C;
6}
7export interface RouteProps {
8 location?: H.Location;
9 component?: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
10 render?: ((props: RouteComponentProps<any>) => React.ReactNode);
11 children?: ((props: RouteChildrenProps<any>) => React.ReactNode) | React.ReactNode;
12 path?: string | string[];
13 exact?: boolean;
14 sensitive?: boolean;
15 strict?: boolean;
16}
17export class Route<T extends RouteProps = RouteProps> extends React.Component<T, any> { }