Merge branch 'toolbarandroid-props-change-fix'

This commit is contained in:
Joel Arvidsson
2016-03-27 21:02:11 -05:00

View File

@@ -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);
}
}
},