DefinitelyTyped/types/react-router-native/index.d.ts
Cina Saffary c9912af2ba [react-router] update types for v5.1.0 (#38578)
* [react-router] update types for v5.1.0

* [react-router] add location state type params to history/location hooks

* [react-router-dom] add support for Link#to: Function

* [react-router-dom] add type definition for Route#component prop
2019-09-25 12:29:48 +01:00

57 lines
1.4 KiB
TypeScript

// Type definitions for React Router Native 5.1
// Project: https://github.com/reacttraining/react-router
// Definitions by: Eduard Zintz <https://github.com/ezintz>
// Fernando Helwanger <https://github.com/fhelwanger>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
export {
match,
matchPath,
MemoryRouter,
Prompt,
Redirect,
Route,
RouteComponentProps,
RouteProps,
Router,
RouterChildContext,
StaticRouter,
Switch,
withRouter,
useHistory,
useLocation,
useParams,
useRouteMatch,
} from 'react-router';
import * as React from 'react';
import * as H from 'history';
export interface BackButtonProps {
children?: React.ReactNode;
}
export class BackButton extends React.Component<BackButtonProps> {}
export class AndroidBackButton extends React.Component<BackButtonProps> {}
export class DeepLinking extends React.Component {}
export interface LinkProps {
component?: React.ComponentType<any>;
replace?: boolean;
style?: any;
to: H.LocationDescriptor;
[propName: string]: any;
}
export class Link extends React.Component<LinkProps> {}
export interface NativeRouterProps {
getUserConfirmation?: Function;
keyLength?: number;
initialEntries?: string[];
initialIndex?: number;
}
export class NativeRouter extends React.Component<NativeRouterProps> {}