diff --git a/src/index.js.flow b/src/index.js.flow index 9641f93c..4645e3c8 100644 --- a/src/index.js.flow +++ b/src/index.js.flow @@ -23,6 +23,8 @@ import type { RouterSubscriberProps, StaticRouterProps, CreateRouterContextOptions, + RouterActionPush, + RouterActionReplace, } from './types.js.flow'; export * from './utils.js.flow'; @@ -90,8 +92,10 @@ declare export function usePathParam( ]; // Utils -type WithRouterProps = RouteContext & {| +export type WithRouterProps = RouteContext & {| history: BrowserHistory, + push: RouterActionPush, + replace: RouterActionReplace, |}; declare export function withRouter< @@ -99,10 +103,7 @@ declare export function withRouter< Component: ComponentType >( WrappedComponent: Component -): ComponentType< - // $FlowFixMe[deprecated-utility] - $Supertype is deprecated https://github.com/flow-typed/flow-typed/issues/2991 - $Diff>, WithRouterProps> ->; +): ComponentType<$Diff, WithRouterProps>>; declare export function generatePath( pattern: string,