Skip to content

Commit f85ff44

Browse files
committed
Fix issue with overriding component usedPropTypes if the component already existed in the map
1 parent cea8591 commit f85ff44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/util/Components.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,12 @@ Components.prototype.list = function() {
9999
component = this.get(node);
100100
}
101101
if (component) {
102-
usedPropTypes[this._getId(component.node)] = (this._list[i].usedPropTypes || []).filter(function(propType) {
102+
var newUsedProps = (this._list[i].usedPropTypes || []).filter(function(propType) {
103103
return !propType.node || propType.node.kind !== 'init';
104104
});
105+
106+
var componentId = this._getId(component.node);
107+
usedPropTypes[componentId] = (usedPropTypes[componentId] || []).concat(newUsedProps);
105108
}
106109
}
107110
// Assign used props in not confident components to the parent component

0 commit comments

Comments
 (0)