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

Validation for React.PropTypes.oneOf should compare values using Object.is #6131

Closed
chicoxyzzy opened this issue Feb 26, 2016 · 5 comments
Closed

Comments

@chicoxyzzy
Copy link
Contributor

...to check for NaN value proper.

also related to #6130

@chicoxyzzy
Copy link
Contributor Author

should Object.is be polyfilled?

@chicoxyzzy
Copy link
Contributor Author

Object.is``s caveat: do we really want +0to not be equal to-0`?

@zpao
Copy link
Member

zpao commented Feb 26, 2016

This seems reasonable. We've inlined Object.is in a couple places now (it's short) so we'll probably just do do that again.

@chicoxyzzy
Copy link
Contributor Author

@zpao can you point me to such places? Maybe it's time to just use polyfill instead of inlining? :)

@zpao
Copy link
Member

zpao commented Feb 26, 2016

There was some discussion had elsewhere and at least at the time we were trying to avoid another polyfill.

https://github.com/facebook/fbjs/blob/52d3eeb9b156e7ebf578c7fe2b3f1eac76a0fd00/src/core/shallowEqual.js#L20-L32

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

No branches or pull requests

2 participants