Skip to content

Commit

Permalink
chore(icon): Add a warning in Javascript console when className and s…
Browse files Browse the repository at this point in the history
…tyle props are used.
  • Loading branch information
lzcabrera committed Sep 18, 2017
1 parent ba557ca commit debd072
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/old-components/Icon/Icon.jsx
Original file line number Diff line number Diff line change
@@ -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}`]}
Expand Down

0 comments on commit debd072

Please sign in to comment.