diff --git a/src/components/icon.jsx b/src/components/icon.jsx
index e444cd4b..3a2aea25 100644
--- a/src/components/icon.jsx
+++ b/src/components/icon.jsx
@@ -1,3 +1,4 @@
+import moize from 'moize';
import { useEffect, useRef, useState } from 'preact/hooks';
const SIZES = {
@@ -110,6 +111,29 @@ export const ICONS = {
const ICONDATA = {};
+// Memoize the dangerouslySetInnerHTML of the SVGs
+const SVGICon = moize(
+ function ({ size, width, height, body, rotate, flip }) {
+ return (
+
+ );
+ },
+ {
+ isShallowEqual: true,
+ maxSize: Object.keys(ICONS).length,
+ },
+);
+
function Icon({
icon,
size = 'm',
@@ -150,16 +174,24 @@ function Icon({
}}
>
{iconData && (
-
+
)}