Skip to content

Commit

Permalink
Merge branch 'toolbarandroid-props-change-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed Mar 28, 2016
2 parents ce22fd8 + 0bdb671 commit abcdfd3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/create-icon-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,18 @@ function createIconSet(glyphMap : Object, fontFamily : string, fontFile : string
componentWillReceiveProps: function(nextProps) {
var keys = Object.keys(IconToolbarAndroid.propTypes);
if(!isEqual(pick(nextProps, keys), pick(this.props, keys))) {
this.updateIconSources(nextProps);
var stateToEvict = [];
if (!nextProps.navIconName) {
stateToEvict.push('navIcon');
}
if (!nextProps.iconName) {
stateToEvict.push('icon');
}
if (this.state && stateToEvict.length) {
this.replaceState(omit(this.state, stateToEvict), () => this.updateIconSources(nextProps));
} else {
this.updateIconSources(nextProps);
}
}
},

Expand Down

0 comments on commit abcdfd3

Please sign in to comment.