@@ -11,17 +11,11 @@ function routeParamsChanged(route, prevState, nextState) {
11
11
} )
12
12
}
13
13
14
- function routeQueryChanged ( prevState , nextState ) {
15
- return prevState . location . search !== nextState . location . search
16
- }
17
-
18
14
/**
19
15
* Returns an object of { leaveRoutes, enterRoutes } determined by
20
16
* the change from prevState to nextState. We leave routes if either
21
17
* 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).
25
19
*
26
20
* leaveRoutes are ordered starting at the leaf route of the tree
27
21
* we're leaving up to the common parent route. enterRoutes are ordered
@@ -34,9 +28,7 @@ function computeChangedRoutes(prevState, nextState) {
34
28
let leaveRoutes , enterRoutes
35
29
if ( prevRoutes ) {
36
30
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 )
40
32
} )
41
33
42
34
// onLeave hooks start at the leaf route.
0 commit comments