react/prop-types thinks built-in methods should be defined in the propTypes when using oneOfType #148
Closed
Description
opened on Jul 14, 2015
import React from 'react/addons';
export default React.createClass({
propTypes: {
data: React.PropTypes.oneOfType([
React.PropTypes.object,
React.PropTypes.array
]).isRequired
},
render() {
let content;
if (this.props.data.length) {
content = this.props.data.map((pair, i) => (
// ..
));
}
return content;
}
});
error 'data.length' is missing in props validation react/prop-types
error 'data.map' is missing in props validation react/prop-types
Metadata
Assignees
Labels
No labels
Activity