Skip to content

[@types/react] type Ref does not include MutableRefObject but probably should. #39062

@aappddeevv

Description

@aappddeevv

I ran into a situation where I needed a MutableObjectRef in a child component so I could set the .current property manually--I was wrapping an old component that provides a function callback to get the html node element.

However, I could not do that without a cast in React.forwardRef as React.Ref includes React.RefObject but does not React.MutableObjectRef.

Thoughts?

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