@@ -11,17 +11,11 @@ function routeParamsChanged(route, prevState, nextState) {
1111 } )
1212}
1313
14- function routeQueryChanged ( prevState , nextState ) {
15- return prevState . location . search !== nextState . location . search
16- }
17-
1814/**
1915 * Returns an object of { leaveRoutes, enterRoutes } determined by
2016 * the change from prevState to nextState. We leave routes if either
2117 * 1) they are not in the next state or 2) they are in the next state
22- * but their params have changed (i.e. /users/123 => /users/456) or
23- * 3) they are in the next state but the query has changed
24- * (i.e. /search?query=foo => /search?query=bar)
18+ * but their params have changed (i.e. /users/123 => /users/456).
2519 *
2620 * leaveRoutes are ordered starting at the leaf route of the tree
2721 * we're leaving up to the common parent route. enterRoutes are ordered
@@ -34,9 +28,7 @@ function computeChangedRoutes(prevState, nextState) {
3428 let leaveRoutes , enterRoutes
3529 if ( prevRoutes ) {
3630 leaveRoutes = prevRoutes . filter ( function ( route ) {
37- return nextRoutes . indexOf ( route ) === - 1
38- || routeParamsChanged ( route , prevState , nextState )
39- || routeQueryChanged ( prevState , nextState )
31+ return nextRoutes . indexOf ( route ) === - 1 || routeParamsChanged ( route , prevState , nextState )
4032 } )
4133
4234 // onLeave hooks start at the leaf route.
0 commit comments