JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1139815
  • Score
    100M100P100Q180935F
  • License MIT

TypeScript definitions for react-router-config

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/react-router-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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

    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

    Credits

    These definitions were written by John Reilly, and Mathieu TUDISCO.