react-page-routes
Version:
Simplify coding your react-router-dom <Routes/> and <NavLinks/> by using attributes in your component.
15 lines (14 loc) • 455 B
TypeScript
import { ReactElement, FC } from 'react';
export declare function useDirectory(...pages: PageType[]): {
Pages: (props: MapperPropsType) => JSX.Element;
NavBar: (props: MapperPropsType) => JSX.Element;
};
export type PageType = (FC & {
title: string;
path: string;
}) | never;
export type MapperType = (E: PageType) => ReactElement;
export type MapperPropsType = {
map?: MapperType;
};
export declare const routes: typeof useDirectory;