File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -167,10 +167,6 @@ function createRouter(options) {
167
167
}
168
168
}
169
169
170
- function updateState ( ) {
171
- state = nextState ;
172
- }
173
-
174
170
if ( typeof location === 'string' ) {
175
171
warning (
176
172
! canUseDOM || process . env . NODE_ENV === 'test' ,
@@ -399,13 +395,14 @@ function createRouter(options) {
399
395
if ( error || transition . isAborted )
400
396
return dispatchHandler . call ( router , error , transition ) ;
401
397
402
- nextState = { } ;
403
- nextState . path = path ;
404
- nextState . action = action ;
405
- nextState . pathname = pathname ;
406
- nextState . routes = nextRoutes ;
407
- nextState . params = nextParams ;
408
- nextState . query = nextQuery ;
398
+ nextState = {
399
+ path : path ,
400
+ action : action ,
401
+ pathname : pathname ,
402
+ routes : nextRoutes ,
403
+ params : nextParams ,
404
+ query : nextQuery
405
+ } ;
409
406
410
407
dispatchHandler . call ( router , null , transition ) ;
411
408
} ) ;
@@ -498,13 +495,11 @@ function createRouter(options) {
498
495
} ,
499
496
500
497
getInitialState : function ( ) {
501
- updateState ( ) ;
502
- return state ;
498
+ return ( state = nextState ) ;
503
499
} ,
504
500
505
501
componentWillReceiveProps : function ( ) {
506
- updateState ( ) ;
507
- this . setState ( state ) ;
502
+ this . setState ( state = nextState ) ;
508
503
} ,
509
504
510
505
componentWillUnmount : function ( ) {
You can’t perform that action at this time.
0 commit comments