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

12 lines (11 loc) 612 B
import { IAsyncProps } from './Async'; import React from 'react'; declare type FetchState<T extends any = object> = ((payload: T) => Promise<any>) | ((payload: T) => any); export interface IFetchViewProps<P extends any = object> extends Omit<IAsyncProps<P>, keyof { children: never; }> { state: FetchState<P> | FetchState<P>[]; children: (...data: any[]) => Promise<React.ReactNode>; } export declare const FetchView: <P extends any = object>({ Loader, Error, onLoadEnd, onLoadStart, children, state, payload, ...otherProps }: IFetchViewProps<P>) => JSX.Element; export default FetchView;