How to use the airbnb-prop-types.numericString function in airbnb-prop-types

To help you get started, we’ve selected a few airbnb-prop-types 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 CityOfBoston / boston.gov-d8 / docroot / modules / custom / bos_components / modules / bos_web_app / apps / metrolist / src / components / Icon / index.js View on Github external
<picture>
      <source srcset="{" type="image/svg+xml" data-testid="ml-icon__svg">
      <img alt="{" srcset="{" src="{">
    </picture>
  );
}

Icon.propTypes = {
  "icon": PropTypes.string.isRequired,
  "width": numericString(),
  "height": numericString(),
  "alt": PropTypes.string.isRequired,
  "fallbackExtension": PropTypes.string,
};

Icon.defaultProps = {
  "fallbackExtension": "png",
};

export default Icon;
github CityOfBoston / boston.gov-d8 / docroot / modules / custom / bos_components / modules / bos_web_app / apps / metrolist / src / components / Icon / index.js View on Github external
return (
    <picture>
      <source srcset="{" type="image/svg+xml" data-testid="ml-icon__svg">
      <img alt="{" srcset="{" src="{">
    </picture>
  );
}

Icon.propTypes = {
  "icon": PropTypes.string.isRequired,
  "width": numericString(),
  "height": numericString(),
  "alt": PropTypes.string.isRequired,
  "fallbackExtension": PropTypes.string,
};

Icon.defaultProps = {
  "fallbackExtension": "png",
};

export default Icon;