Skip to content

Commit

Permalink
fix(react): icons with MD set should work in browser (#20463)
Browse files Browse the repository at this point in the history
  • Loading branch information
elylucas committed Feb 14, 2020
1 parent c0aadd6 commit 82670fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
21 changes: 1 addition & 20 deletions packages/react/src/components/IonIcon.tsx
Expand Up @@ -34,25 +34,6 @@ class IonIconContainer extends React.PureComponent<InternalProps> {
}
}

setIcon() {
const { icon, ios, md } = this.props;
if (ios || md) {
if (isPlatform('ios')) {
this.setState({
icon: ios ?? md ?? icon
});
} else if (isPlatform('android')) {
this.setState({
icon: md ?? ios ?? icon
});
}
} else {
this.setState({
icon
});
}
}

render() {
const { icon, ios, md, ...rest } = this.props;

Expand All @@ -61,7 +42,7 @@ class IonIconContainer extends React.PureComponent<InternalProps> {
if (ios || md) {
if (isPlatform('ios')) {
iconToUse = ios ?? md ?? icon;
} else if (isPlatform('android')) {
} else {
iconToUse = md ?? ios ?? icon;
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion packages/react/tslint.json
Expand Up @@ -28,6 +28,7 @@
"jsx-no-multiline-js": false,
"jsx-wrap-multiline": false,
"no-empty-interface": false,
"no-unbound-method": false
"no-unbound-method": false,
"prefer-conditional-expression": false
}
}

0 comments on commit 82670fe

Please sign in to comment.