diff --git a/components/react/src/offline.ts b/components/react/src/offline.ts index 4cd4aa5..8784910 100644 --- a/components/react/src/offline.ts +++ b/components/react/src/offline.ts @@ -1,4 +1,4 @@ -import { forwardRef, createElement, type Ref } from 'react'; +import { forwardRef, createElement, memo, type Ref } from 'react'; import type { IconifyIcon, IconifyJSON } from '@iconify/types'; import type { IconifyIconSize } from '@iconify/utils/lib/customisations/defaults'; import { defaultIconProps } from '@iconify/utils/lib/icon/defaults'; @@ -63,25 +63,25 @@ type IconComponentType = (props: IconProps) => JSX.Element; * * @param props - Component properties */ -export const Icon = forwardRef((props, ref) => +export const Icon = memo(forwardRef((props, ref) => IconComponent({ ...props, _ref: ref, }) -) as IconComponentType; +)) as IconComponentType; /** * Inline icon (has negative verticalAlign that makes it behave like icon font) * * @param props - Component properties */ -export const InlineIcon = forwardRef((props, ref) => +export const InlineIcon = memo(forwardRef((props, ref) => IconComponent({ inline: true, ...props, _ref: ref, }) -) as IconComponentType; +)) as IconComponentType; /** * Add icon to storage, allowing to call it by name