Skip to content

Not working with forwardRef #161

Description

@mrondra

Hi,

I have a problem with forwardRef and Typescript. Example below:

const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function headingFunction(
    props: HeadingProps,
    ref,
): ReactElement<HeadingProps, HeadingProps['tag']> | null {
    ...
});

Heading.whyDidYouRender = true;     

And I get this error:

TS2339: Property 'whyDidYouRender' does not exist on type 'ForwardRefExoticComponent  >'

Do you have any idea what to do with it?

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions