Answer the question
In order to leave comments, you need to log in
What is the reason for the prop-types typecheck error?
There is a simple code:
import PropTypes from 'prop-types';
const UsersList = props => (
<div className="container">
{props.loading ? '1' : '2'}
</div>
);
UsersList.propTypes = {
loading: PropTypes.bool()
};
Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at fb.me/use-check-prop-types
Answer the question
In order to leave comments, you need to log in
The typical and primitive case is described as follows:
UsersList.propTypes = {
loading: PropTypes.bool
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question