facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

Warn when multiple arguments were supplied to oneOf #244

Closed wojtekmaj closed 5 years ago

wojtekmaj commented 5 years ago

Adds a different warning message for multiple arguments supplied to oneOf. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]) and this should help developers identifying the error.

wojtekmaj commented 5 years ago

Thanks for reviewing @ljharb. Force pushed to squash and change the unit tests to remove "instance of" from the strings you've changed.