in src/helpers/propTypes.js [84:110]
export function selectedIndexPropType(
props,
propName,
componentName,
location,
propFullName,
) {
const prop = props[propName];
const name = propFullName || propName;
let error = null;
if (prop != null && typeof prop !== 'number') {
error = new Error(
`Invalid ${location} \`${name}\` of type \`${typeof prop}\` supplied to ` +
`\`${componentName}\`, expected \`number\`.`,
);
} else if (props.defaultIndex != null && prop != null) {
return new Error(
`The ${location} \`${name}\` cannot be used together with \`defaultIndex\` ` +
`in \`${componentName}\`.\n` +
`Either remove \`${name}\` to let \`${componentName}\` handle the selected ` +
`tab internally or remove \`defaultIndex\` to handle it yourself.`,
);
}
return error;
}