Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expected types to oneOfType warning #198

Merged
merged 1 commit into from Feb 28, 2019

Conversation

joshalling
Copy link
Contributor

@joshalling joshalling commented Jul 20, 2018

Adds data object to returned error in type checker so that the expected types can be accessed from within oneOfType check. Also, updates the tests slightly.

Fixes #9. Fixes facebook/react#1919.

Adds data object to returned error in checker so that the expected types can be accessed from within oneOfType check. Also, updates the tests slightly.

Fixes facebook#9.
@joshalling joshalling force-pushed the one-of-type-warnings branch 2 times, most recently from 22a6083 to 587cb59 Compare July 21, 2018 05:05
@joshalling joshalling changed the title Add expected types to oneOfType warning (#9) Add expected types to oneOfType warning Jul 21, 2018
@ljharb ljharb merged commit 3910873 into facebook:master Feb 28, 2019
@oliviertassinari
Copy link

❤️

return null;
}
if (checkerResult.data.hasOwnProperty('expectedType')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for posterity: assuming .data exists, and also calling .hasOwnProperty directly off of an object, caused #369.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants