-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Ensure DOM nodes can be found for trigger
elements and as
components
#1321
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
There has been no activity in this thread for 90 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 90 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
See #1190 for context
TL;DR
You cannot locate a DOM node for a functional component. We allow users to pass components and elements into our components. We then sometimes try to locate the DOM node of those passed in components. This results in an error if the user passed a stateless functional component as there is no DOM node.
The solution, create a wrapper class and HOC that locates its own DOM node but renders the child or wrapped component in place.
Progress to date
OK ugly code here, but, I've dug up the experiment I did for this here: http://www.react.run/HJa1BVYQl/24
This would need to be adapted to also work as a HOC rather than only on a child element:
Finally, this component and HOC would need to be implemented everywhere we use a
trigger
and orref
. It would also need to be applied insrc/lib/getElementType
, which powers theas
prop, so that allas
components can useref
s.If anyone would like to pick this up, that would beyond amazing 👍
The text was updated successfully, but these errors were encountered: