mirror of
https://github.com/zhigang1992/react-native-vector-icons.git
synced 2026-06-19 01:55:56 +08:00
Merge branch 'toolbarandroid-props-change-fix'
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user