From debd0724567a01da6e14c6d6e6ca6cc8305fd112 Mon Sep 17 00:00:00 2001 From: Laura Cabrera Date: Mon, 18 Sep 2017 16:40:19 -0700 Subject: [PATCH] chore(icon): Add a warning in Javascript console when className and style props are used. --- src/old-components/Icon/Icon.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/old-components/Icon/Icon.jsx b/src/old-components/Icon/Icon.jsx index a4b03d438e..6fa5fce2d9 100644 --- a/src/old-components/Icon/Icon.jsx +++ b/src/old-components/Icon/Icon.jsx @@ -1,8 +1,19 @@ import React from 'react' import PropTypes from 'prop-types' + +import { warn } from '../../warn' + import styles from './Icon.modules.scss' const Icon = ({ glyph, variant, fixedWidth, size, className, children, ...rest }) => { + if (className) { + warn('Icon', 'Custom CSS classes are deprecated. This component does not support custom styling.') + } + + if (rest.style) { + warn('Icon', 'Inline styles are deprecated. This component does not support custom styling.') + } + const classes = ` ${styles.icon} ${styles[`icon-core-${glyph}`]}