How to use the @commercetools-uikit/utils.warnDeprecatedProp function in @commercetools-uikit/utils

To help you get started, we’ve selected a few @commercetools-uikit/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / ui-kit / src / components / buttons / secondary-button / secondary-button.js View on Github external
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,