Skip to content

Commit

Permalink
Fix warnings with FontAwesome5 for web (oblador#825)
Browse files Browse the repository at this point in the history
* Fix warnings with FontAwesome5 for web

* Updating propTypes for FA5

+ Extra fix, never edit code on github.com
  • Loading branch information
soranoba authored and hampustagerud committed Aug 30, 2018
1 parent 63190be commit 1be2425
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/create-icon-set-from-fontawesome5.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,13 @@ export function createFA5iconSet(glyphMap, metadata = {}, proVersion = false) {

function createFA5iconClass(baseClass, selectClass = iconSet => iconSet) {
class FA5iconClass extends PureComponent {
static propTypes = Object.create(baseClass.propTypes, {
light: PropTypes.bool,
solid: PropTypes.bool,
});
static propTypes = [
baseClass.propTypes,
{
light: PropTypes.bool,
solid: PropTypes.bool,
},
];

static defaultProps = {
light: false,
Expand All @@ -150,8 +153,9 @@ export function createFA5iconSet(glyphMap, metadata = {}, proVersion = false) {
render() {
const selectedIconSet = getIconSetForProps(this.props);
const SelectedIconClass = selectClass(selectedIconSet);
const { light, solid, ...restProps } = this.props;

return <SelectedIconClass {...this.props} />;
return <SelectedIconClass {...restProps} />;
}
}

Expand Down

0 comments on commit 1be2425

Please sign in to comment.