UNPKG

@crossfox/react-router

Version:

Lightning-fast and highly functional router for React. Effortlessly manage your application's routing with speed and efficiency

15 lines (14 loc) 850 B
import React from "react"; import { iRouterConfig, iRouterLink } from "./types"; export declare const goTo: (url: string, data?: Record<string, any>) => void; export declare const goBack: (level?: number) => void; export declare const useHistory: () => [string, Record<string, any>][] | null; export declare const useRouterData: () => Record<string, any> | never[]; export declare const useNavigate: () => (url: string, data: Record<string, any>) => void; export declare const useLayout: () => string | null; export declare const Link: (props: iRouterLink) => React.ReactElement<{ onClick?: ((e: MouseEvent) => void) | undefined; href?: string | undefined; }, string | React.JSXElementConstructor<any>>; declare function createRouter(routerData: Record<string, any>): (props: iRouterConfig) => React.JSX.Element; export default createRouter;