Skip to content

Remove dependency on ReactDOM.findDOMNode #55

Open
@10xjs

Description

@10xjs

findDOMNode is slated for deprecation soon, and support in React 16 appears to be partially dropped already.

We currently rely on a custom findDOMNode function that will safely attempt to detect the rendered node using react fiber internals when necessary. This universally supports React 16 and earlier versions.

This isn't the best long-term solution since it relies on undocumented internals.

Dan recomments passing a ref handler prop down throug the component tree: jsx-eslint/eslint-plugin-react#678.

I'm not completely sold on this approach as it would complicate the consumer-facing interface. The provided content handler would need to manually pass a contentRef prop to its outermost element. Although this isn't too different from how the style prop is used.

Looking for ideas.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions