Skip to content

Clarify why "imperative code using refs should be avoided in most cases." #3872

Description

@OldStarchy

The docs for useImperitiveHandle state

useImperativeHandle customizes the instance value that is exposed to parent components when using ref. As always, imperative code using refs should be avoided in most cases. useImperativeHandle should be used with forwardRef

I'm wondering why imperative code using refs should be avoided, perhaps this is something that could be added to the docs?

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