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 <
The real explanation behind this issue is that react expects a PropType which is technically a function, aka checker. Examples for checker functions are:
PropTypes.array
PropTypes.shape({...})
PropTypes.bool
You got the idea... So what happens here is whenever you pass in something which isn't a checker, for example an undefined
, react won't know what to do with this and so will complain:
checker is not a function
In my case, the cause was misspelling of the checker functions:
PropTypes.shape({
cats: PropTypes.Array // this is undefined
})
The correct version should be:
PropTypes.shape({
cats: PropTypes.array // lowercase is correct!
})