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

Check null, undefined, NaN #92

Open
xahon opened this issue Jul 20, 2017 · 1 comment
Open

Check null, undefined, NaN #92

xahon opened this issue Jul 20, 2017 · 1 comment
Labels
new validator request Requests for a new kind of validator. question

Comments

@xahon
Copy link

xahon commented Jul 20, 2017

How can i check if passed value is null, undefined, NaN?

@xahon xahon changed the title Check either array or null Check null, undefined, NaN Jul 20, 2017
@ljharb
Copy link
Collaborator

ljharb commented Jul 20, 2017

@xahon PropTypes.oneOf(NaN) should work there.

I built explicitNull in airbnb-prop-types to detect that case; for undefined, this is a bit of a duplicate of #57.

@ljharb ljharb added question new validator request Requests for a new kind of validator. labels Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new validator request Requests for a new kind of validator. question
Projects
None yet
Development

No branches or pull requests

2 participants