Skip to content

Commit

Permalink
Fixed a bug in the Component.prototype.list utility to properly han…
Browse files Browse the repository at this point in the history
…dle props inside functional components. Needed for the new `unused-prop-types` rule.
  • Loading branch information
Evgueni Naverniouk committed Jul 26, 2016
1 parent e2dbee2 commit fcd9d59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Components.prototype.list = function() {
}
if (component) {
usedPropTypes[this._getId(component.node)] = (this._list[i].usedPropTypes || []).filter(function(propType) {
return propType.node.kind !== 'init';
return !propType.node || propType.node.kind !== 'init';
});
}
}
Expand Down

0 comments on commit fcd9d59

Please sign in to comment.