File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var invariant = require('./util/invariant');
55var assign = Object . assign || require ( 'object-assign' ) ;
66var matchRoutes = require ( './matchRoutes' ) ;
77var Environment = require ( './environment' ) ;
8+ var shallowEqual = require ( 'is-equal-shallow' ) ;
89
910var RouterMixin = {
1011 mixins : [ Environment . Mixin ] ,
@@ -39,8 +40,10 @@ var RouterMixin = {
3940 } ,
4041
4142 componentWillReceiveProps : function ( nextProps ) {
42- var nextState = this . getRouterState ( nextProps ) ;
43- this . delegateSetRoutingState ( nextState ) ;
43+ if ( ! shallowEqual ( nextProps , this . props ) ) {
44+ var nextState = this . getRouterState ( nextProps ) ;
45+ this . delegateSetRoutingState ( nextState ) ;
46+ }
4447 } ,
4548
4649 getRouterState : function ( props ) {
Original file line number Diff line number Diff line change 44 "description" : " Declarative router component for React" ,
55 "main" : " index.js" ,
66 "dependencies" : {
7+ "is-equal-shallow" : " ^0.1.3" ,
78 "object-assign" : " ^4.1.0" ,
89 "object.omit" : " ^2.0.0" ,
910 "qs" : " ^6.2.0" ,
7071 "publishConfig" : {
7172 "registry" : " https://registry.npmjs.org"
7273 }
73- }
74+ }
You can’t perform that action at this time.
0 commit comments