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

Use React.createRef() to track child nodes (Remove ReactDOM dependency) #437

Closed
wants to merge 1 commit into from

Conversation

kjkta
Copy link

@kjkta kjkta commented Dec 15, 2018

Here's a potential solution to removing ReactDOM peer dependency.

@taion
Copy link
Member

taion commented Dec 15, 2018

there’s no guarantee the child will be a DOM node. among other things

@kjkta
Copy link
Author

kjkta commented Dec 15, 2018

How does using refs to identify a node (if there is one) differ to using ReactDOM.findNode?

@Miklet
Copy link

Miklet commented Jan 3, 2019

ref can be a node but also can be a component's instance. Using ReactDOM.findNode always return underlaying node (unless it renders null or false). Passing explicitly a ref would guarantee it but it would break API.

@jquense jquense closed this Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants