From 82670fe4d0592451cbc243b3008beb3f8f483c30 Mon Sep 17 00:00:00 2001 From: Ely Lucas Date: Wed, 12 Feb 2020 14:25:35 -0700 Subject: [PATCH] fix(react): icons with MD set should work in browser (#20463) --- packages/react/src/components/IonIcon.tsx | 21 +-------------------- packages/react/tslint.json | 3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/packages/react/src/components/IonIcon.tsx b/packages/react/src/components/IonIcon.tsx index 94bf38e62e..c01ba9f2d3 100644 --- a/packages/react/src/components/IonIcon.tsx +++ b/packages/react/src/components/IonIcon.tsx @@ -34,25 +34,6 @@ class IonIconContainer extends React.PureComponent { } } - 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 { if (ios || md) { if (isPlatform('ios')) { iconToUse = ios ?? md ?? icon; - } else if (isPlatform('android')) { + } else { iconToUse = md ?? ios ?? icon; } } else { diff --git a/packages/react/tslint.json b/packages/react/tslint.json index fb8fdaa478..ba6516b917 100644 --- a/packages/react/tslint.json +++ b/packages/react/tslint.json @@ -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 } }