Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React linter airbnb proptypes array

I have the following PropTypes:

SmartTable.propTypes = {   name: React.PropTypes.string.isRequired,   cols: React.PropTypes.array.isRequired,   rows: React.PropTypes.array.isRequired, }; 

but the linter says me:

Prop type "array" is forbidden, how can I change it?

like image 648
FacundoGFlores Avatar asked Jan 20 '17 19:01

FacundoGFlores


1 Answers

A possible solution for this (but I think it is not smart):

SmartTable.propTypes = {   name: React.PropTypes.string.isRequired,   cols: React.PropTypes.arrayOf(React.PropTypes.string),   rows: React.PropTypes.arrayOf(React.PropTypes.string), }; 
like image 129
FacundoGFlores Avatar answered Sep 29 '22 04:09

FacundoGFlores