How to use the @commercetools-uikit/utils.getPassThroughProps 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 / links / link / link.js View on Github external
const Link = props => {
  const remainingProps = getPassThroughProps(
    props,
    Object.keys(Link.propTypes)
  );

  if (props.isExternal) {
    return (
      <a> getLinkStyles(props, theme)}
        href={props.to}
        target="_blank"
        rel="noopener noreferrer"
        {...remainingProps}
      /&gt;
    );
  }
  return (</a>
github commercetools / ui-kit / src / components / buttons / link-button / link-button.js View on Github external
const LinkButton = props =&gt; {
  React.useEffect(() =&gt; {
    warnDeprecatedComponent('LinkButton');
  }, []);
  const remainingProps = getPassThroughProps(
    props,
    Object.keys(LinkButton.propTypes)
  );

  if (props.isExternal) {
    return (
       event.preventDefault() : undefined}
        disabled={props.isDisabled}
        data-track-component="LinkButton"
        aria-label={props.label}
        {...remainingProps}
      &gt;