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

Support React 16 #53

Merged
merged 1 commit into from
Mar 15, 2018
Merged

Support React 16 #53

merged 1 commit into from
Mar 15, 2018

Conversation

10xjs
Copy link
Contributor

@10xjs 10xjs commented Mar 15, 2018

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

For us to transition completely away from it, we would need to pass a ref prop down to the provided content component, including it as part of the FlowTip api. This is less ideal than automatically resolving the correct ref as findDOMNode currently does and would make the lib more complicated to use. (See: #55)

Until findDOMNode support is dropped completely, or we decide on a clean mechanism for passing the ref around, we 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.

See:

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

For us to transition completely away from it, we would need to pass a ref prop down to the provided `content` component, including it as part of the `FlowTip` api. This is less ideal than automatically resolving the correct ref as `findDOMNode` currently does and would make the lib more complicated to use.

Until `findDOMNode` support is dropped completely, or we decide on a clean mechanism for passing the ref around, we 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.

(See: https://stackoverflow.com/questions/48062095/update-to-react-16-finddomnode-stops-working#answer-48273014)
Copy link
Contributor

@izaakschroeder izaakschroeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hacks away! 🚀

@10xjs 10xjs merged commit e83eba5 into master Mar 15, 2018
@10xjs 10xjs deleted the fiber-support branch March 15, 2018 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants