Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Friendlier message when using a type checker that is not a function #51

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

gouegd
Copy link

@gouegd gouegd commented May 13, 2017

Just a text change, adds a stronger hint as to the most common issue.
This tries to prevent confusion as discussed in #33

Sample:

> PropTypes.checkPropTypes({pname: PropTypes.stringzz}, {pname: false}, 'prop', 'MyCompo')
Warning: Failed prop type: MyCompo: type specification of prop `pname` is invalid; the type checker must be a function but is `undefined`. This often happens because of typos such as `React.PropTypes.function` instead of `React.PropTypes.func`.

Fixes #33.

@kevincoleman
Copy link

kevincoleman commented Sep 10, 2018

Bump.

Ran into this little confusion; googled it, and found this whole issue/PR thread. Simple change, just merge!

@ljharb
Copy link
Contributor

ljharb commented Feb 21, 2019

(07d1b47 added the "received" type)

@ljharb ljharb force-pushed the better-message-undefined-prop-type branch 2 times, most recently from e341666 to b925248 Compare February 21, 2019 22:15
@ljharb ljharb force-pushed the better-message-undefined-prop-type branch from b925248 to 71bdfe3 Compare February 21, 2019 22:28
@ljharb ljharb merged commit 71bdfe3 into facebook:master Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants