-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Migrate from findDOMNode to refs #13221
Comments
I believe this would be a breaking change. The API allows in many cases that users pass a custom root component. We still need |
This is such a big move from React. For a long time, I thought they weren't going to execute on this. From what I understand, the motivation is around simplifying React internal core. This makes sense. Let's see how we can fulfill this new constraint. |
React 16.6 will log deprecation warnings in strict mode about this. Will be good way to gauge the impact of this change |
This is also important because React recommends passing StrictMode before enabling concurrent React. It is unstable right now but should be finalized this year. |
This is the actual driving factor for us. We've made some progress but |
For more details see https://material-ui.com/guides/composition/#caveat-with-refs |
Is that because
Can't class components be wrapped in |
Yes. Just reducing the amount of breaking changes.
At least for now. We're still waiting for an official confirmation but so far |
React team just finally announced deprecating
findDOMNode
.facebook/react#13841
Would be good to start providing better refs in each component to get rid from
RootRef
.Edit @eps1lon: Hijacking OP to document progress.
If we need the DOM node we still use
findDOMNode
but we call it with refs. If the refs are attached to host components you won't get a strict mode warning. Only if they are attached to class components.Strict-mode ready findDOMNode
[ ] RootRefcompat moduleThe text was updated successfully, but these errors were encountered: