As the document says here
array and object can be replaced with arrayOf and shape, respectively.
So, I did this in my project:
class X extends React.Component {
....
}
X.propTypes = {
somePorp: PropTypes.shape.isRequired, // this cause an warnning in firefox, but satisfied eslint syntax check
somePorp: PropTypes.object.isRequired, // no warnning in firefox, but can not satisfy eslint syntax check
}
Question:
How can I avoid warning message in firefox, as well as pass eslint syntax check (it's better no modification of eslint default rule)?
BTW: firefox warning is something like below
Warning: Failed prop type: X: prop type
classes
is invalid; it must be a function, usually from theprop-types
package, but receivedundefined
.