Skip to content

Commit

Permalink
Fix issue with overriding component usedPropTypes if the component al…
Browse files Browse the repository at this point in the history
…ready existed in the map
  • Loading branch information
jseminck committed May 22, 2017
1 parent cea8591 commit f85ff44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ Components.prototype.list = function() {
component = this.get(node);
}
if (component) {
usedPropTypes[this._getId(component.node)] = (this._list[i].usedPropTypes || []).filter(function(propType) {
var newUsedProps = (this._list[i].usedPropTypes || []).filter(function(propType) {
return !propType.node || propType.node.kind !== 'init';
});

var componentId = this._getId(component.node);
usedPropTypes[componentId] = (usedPropTypes[componentId] || []).concat(newUsedProps);
}
}
// Assign used props in not confident components to the parent component
Expand Down

0 comments on commit f85ff44

Please sign in to comment.