I\'m getting this weird warning message in the console for my React app.
Warning: Failed propType: checker is not a function Check the render method of <
In my case, I was validating props wrong. I forgot to wrap the profile object into PropTypes
shape method.
Mistake
Component.propTypes = {
viewProfile: PropTypes.shape({
profile: { // it is a normal object without a PropTypes shape method
firstName: PropTypes.string,
lastName: PropTypes.string,
profileImage: PropTypes.string,
},
}).isRequired,
};
Solution
Component.propTypes = {
viewProfile: PropTypes.shape({
profile: PropTypes.shape({
firstName: PropTypes.string,
lastName: PropTypes.string,
profileImage: PropTypes.string,
}),
}).isRequired,
};