react-router-breadcrumbs-hoc
Version:
small, flexible, higher order component for rendering breadcrumbs with react-router 4.x
34 lines (33 loc) • 1.1 kB
TypeScript
import React from 'react';
export interface Options {
currentSection?: string;
disableDefaults?: boolean;
excludePaths?: string[];
pathSection?: string;
}
export interface Location {
pathname: string;
}
export interface MatchOptions {
exact?: boolean;
strict?: boolean;
sensitive?: boolean;
}
export interface BreadcrumbsRoute {
path: string;
breadcrumb?: React.ComponentType | React.ElementType | string;
matchOptions?: MatchOptions;
routes?: BreadcrumbsRoute[];
[x: string]: any;
}
export declare const getBreadcrumbs: ({ routes, location, options, }: {
routes: BreadcrumbsRoute[];
location: Location;
options?: Options | undefined;
}) => Array<React.ReactNode | string>;
declare const withBreadcrumbs: (routes?: BreadcrumbsRoute[] | undefined, options?: Options | undefined) => (Component: React.ComponentType<{
breadcrumbs: Array<React.ReactNode | string>;
}>) => (props: any) => React.ReactElement<{
breadcrumbs: Array<React.ReactNode | string>;
}, string | React.JSXElementConstructor<any>>;
export default withBreadcrumbs;