Skip to content

Commit 503d095

Browse files
swissmanuunional
authored andcommitted
Change replace signature to use only LocationDescriptor (#15)
react-router expects a path in form of a string or a LocationDescriptor as only argument for onEnters replace function. See https://github.com/ReactTraining/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors
1 parent b535d3a commit 503d095

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react-router.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ declare namespace ReactRouter {
558558

559559
type ChangeHook = (prevState: RouterState, nextState: RouterState, replace: RedirectFunction, callback?: Function) => any;
560560

561-
type RedirectFunction = (state: LocationState, pathname: Pathname | Path, query?: Query) => void;
561+
type RedirectFunction = (pathOrLoc: LocationDescriptor) => void;
562562

563563
type LocationState = Object;
564564

0 commit comments

Comments
 (0)