Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import type {
RouterSubscriberProps,
StaticRouterProps,
CreateRouterContextOptions,
RouterActionPush,
RouterActionReplace,
} from './types.js.flow';

export * from './utils.js.flow';
Expand Down Expand Up @@ -90,19 +92,18 @@ declare export function usePathParam(
];

// Utils
type WithRouterProps = RouteContext & {|
export type WithRouterProps = RouteContext & {|
history: BrowserHistory,
push: RouterActionPush,
replace: RouterActionReplace,
|};

declare export function withRouter<
Props: { ... },
Component: ComponentType<Props>
>(
WrappedComponent: Component
): ComponentType<
// $FlowFixMe[deprecated-utility] - $Supertype is deprecated https://github.com/flow-typed/flow-typed/issues/2991
$Diff<ElementConfig<$Supertype<Component>>, WithRouterProps>
>;
): ComponentType<$Diff<ElementConfig<Component>, WithRouterProps>>;

declare export function generatePath(
pattern: string,
Expand Down