2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-12 01:45:41 +00:00

Fix React icon ref element

This commit is contained in:
Nghiệp 2021-08-16 09:04:15 +07:00
parent aaa0f5dfdf
commit 258af29f7c

View File

@ -1,4 +1,4 @@
import type { HTMLProps, RefObject } from 'react';
import type { HTMLProps, RefAttributes } from 'react';
import type { IconifyIcon } from '@iconify/types';
import type { IconifyIconCustomisations as RawIconCustomisations } from '@iconify/utils/lib/customisations';
@ -41,15 +41,15 @@ export interface IconifyIconProps extends IconifyIconCustomisations {
/**
* React component properties: generic element for Icon component, SVG for generated component
*/
type IconifyElementProps = HTMLProps<HTMLElement>;
type IconifyElementProps = HTMLProps<SVGSVGElement>;
export type IconRef = RefObject<SVGElement>;
export type IconRef = RefAttributes<SVGSVGElement>;
export interface ReactRefProp {
ref?: IconRef;
}
/**
* Mix of icon properties and HTMLElement properties
* Mix of icon properties and SVGSVGElement properties
*/
export type IconProps = IconifyElementProps & IconifyIconProps & ReactRefProp;