perf(various): don't use lazy-loaded icon names in components (#24671)

This commit is contained in:
Amanda Smith
2022-01-28 09:13:39 -06:00
committed by GitHub
parent bdb5c421d2
commit 484de5074d
16 changed files with 78 additions and 125 deletions

View File

@@ -1,4 +1,5 @@
import { Component, ComponentInterface, Element, Host, Listen, h } from '@stencil/core';
import { reorderThreeOutline, reorderTwoSharp } from 'ionicons/icons';
import { getIonMode } from '../../global/ionic-global';
@@ -31,11 +32,11 @@ export class Reorder implements ComponentInterface {
render() {
const mode = getIonMode(this);
const reorderIcon = mode === 'ios' ? 'reorder-three-outline' : 'reorder-two-sharp';
const reorderIcon = mode === 'ios' ? reorderThreeOutline : reorderTwoSharp;
return (
<Host class={mode}>
<slot>
<ion-icon name={reorderIcon} lazy={false} class="reorder-icon" part="icon" />
<ion-icon icon={reorderIcon} lazy={false} class="reorder-icon" part="icon" />
</slot>
</Host>
);