mirror of
https://github.com/iconify/iconify.git
synced 2024-12-12 13:47:49 +00:00
chore(react): import jsx from react for react 19 compatibility
This commit is contained in:
parent
60baa1907c
commit
533263df50
@ -1,10 +1,5 @@
|
||||
import {
|
||||
useEffect,
|
||||
useState,
|
||||
forwardRef,
|
||||
createElement,
|
||||
type Ref,
|
||||
} from 'react';
|
||||
import { useEffect, useState, forwardRef, createElement } from 'react';
|
||||
import type { Ref, JSX } from 'react';
|
||||
import type { IconifyJSON, IconifyIcon } from '@iconify/types';
|
||||
|
||||
// Core
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { forwardRef, createElement, memo, type Ref } from 'react';
|
||||
import { forwardRef, createElement, memo } from 'react';
|
||||
import type { Ref, JSX } 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 +64,29 @@ type IconComponentType = (props: IconProps) => JSX.Element;
|
||||
*
|
||||
* @param props - Component properties
|
||||
*/
|
||||
export const Icon = memo(forwardRef<IconElement, IconProps>((props, ref) =>
|
||||
export const Icon = memo(
|
||||
forwardRef<IconElement, IconProps>((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 = memo(forwardRef<IconElement, IconProps>((props, ref) =>
|
||||
export const InlineIcon = memo(
|
||||
forwardRef<IconElement, IconProps>((props, ref) =>
|
||||
IconComponent({
|
||||
inline: true,
|
||||
...props,
|
||||
_ref: ref,
|
||||
})
|
||||
)) as IconComponentType;
|
||||
)
|
||||
) as IconComponentType;
|
||||
|
||||
/**
|
||||
* Add icon to storage, allowing to call it by name
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { createElement } from 'react';
|
||||
import type { SVGProps, CSSProperties } from 'react';
|
||||
import type { SVGProps, CSSProperties, JSX } from 'react';
|
||||
import type { IconifyIcon } from '@iconify/types';
|
||||
import { mergeCustomisations } from '@iconify/utils/lib/customisations/merge';
|
||||
import { flipFromString } from '@iconify/utils/lib/customisations/flip';
|
||||
|
1697
pnpm-lock.yaml
1697
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user