UNPKG

react-history-switch

Version:

Self-hosted context-free Switch routing component for History.js library (React). The library was created to transfer navigation responsibility from a view into Mobx state container (MVC). Also can be used separately as a self-hosted router

11 lines (10 loc) 449 B
/// <reference types="react" /> export interface ISwitchItem { path: string; element?: React.ComponentType<any>; guard?: () => boolean | Promise<boolean>; prefetch?: (params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>; unload?: (params: Record<string, any>) => Promise<void> | void; redirect?: string | ((params: Record<string, any>) => string | null); } export default ISwitchItem;