fix(react): icons with MD set should work in browser (#20463)

This commit is contained in:
Ely Lucas
2020-02-12 14:25:35 -07:00
parent c0aadd6007
commit 82670fe4d0
2 changed files with 3 additions and 21 deletions

View File

@@ -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;
@@ -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 {

View File

@@ -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
}
}