Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
linkTo(props, propName, componentName, ...rest) {
// here
if (props[propName] != null) {
warnDeprecatedProp(
propName,
componentName,
`\n Please use "as" prop instead.`
);
if (props.as) {
return new Error(oneLine`
Invalid prop "${propName}" supplied to "${componentName}".
"${propName}" does not have any effect when "as" is defined`);
}
return PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
pathname: PropTypes.string.isRequired,
search: PropTypes.string,