Skip to content

Commit

Permalink
Improve compatibility of propTypes checking by not using Array.includ…
Browse files Browse the repository at this point in the history
…es()
  • Loading branch information
wojtekmaj committed Sep 10, 2017
1 parent 922a9a3 commit fe20dbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const isView = (props, propName, componentName) => {

const allowedViews = views || allViews;

if (!allowedViews.includes(view)) {
if (allowedViews.indexOf(view) === -1) {
return new Error(`Warning: Failed prop type: Invalid prop \`${propName}\` of value \`${view}\` supplied to \`${componentName}\`, expected one of [${['a', 'b', 'c', 'd', 'e'].map(a => `"${a}"`).join(', ')}].`);
}

Expand Down

0 comments on commit fe20dbb

Please sign in to comment.