Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
location: string,
propFullName: string,
): any => {
const propValue = props[propName];
let Component = propValue;
if (!React.isValidElement(propValue) && isValidElementType(propValue)) {
const ownProps = {
ref: () => {},
step: {},
};
Component = ;
}
if (
is.string(propValue) ||
is.number(propValue) ||
!isValidElementType(propValue) ||
![Element, ForwardRef].includes(typeOf(Component))
) {
return new Error(
`Invalid ${location} \`${propFullName}\` supplied to \`${componentName}\`. Expected a React class or forwardRef.`,
);
}
return undefined;
},
);