Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on ReactDOM.findDOMNode #55

Open
10xjs opened this issue Mar 15, 2018 · 0 comments
Open

Remove dependency on ReactDOM.findDOMNode #55

10xjs opened this issue Mar 15, 2018 · 0 comments

Comments

@10xjs
Copy link
Contributor

10xjs commented Mar 15, 2018

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.

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

No branches or pull requests

1 participant