From 8253d7c04ba017fe1d07f635b1f8074b776e6867 Mon Sep 17 00:00:00 2001 From: Yurii Sichkovskiy Date: Sun, 20 Dec 2020 23:50:27 +0200 Subject: [PATCH 1/2] Switched type FC to ForwardRefRenderFunction in Icon --- src/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 94e32077..8f65ed80 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,12 +1,12 @@ /// -import { FC, SVGAttributes } from 'react'; +import { ForwardRefRenderFunction, SVGAttributes } from 'react'; export interface IconProps extends SVGAttributes { color?: string; size?: string | number; } -export type Icon = FC; +export type Icon = ForwardRefRenderFunction; export const Activity: Icon; export const Airplay: Icon; export const AlertCircle: Icon; From e8aebb6dba5298ad2e95c56003f0c931c5c99d0c Mon Sep 17 00:00:00 2001 From: Yurii Sichkovskiy Date: Mon, 21 Dec 2020 01:10:39 +0200 Subject: [PATCH 2/2] Revert to FC type, worked around the issue by adding `ref` prop to IconProps --- src/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 8f65ed80..e88b0fd3 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,12 +1,13 @@ /// -import { ForwardRefRenderFunction, SVGAttributes } from 'react'; +import { FC, RefObject, SVGAttributes } from 'react'; export interface IconProps extends SVGAttributes { color?: string; size?: string | number; + ref?: RefObject; } -export type Icon = ForwardRefRenderFunction; +export type Icon = FC; export const Activity: Icon; export const Airplay: Icon; export const AlertCircle: Icon;