-
Notifications
You must be signed in to change notification settings - Fork 9
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
Not all components forward refs #1755
Comments
This is very promising and an important piece of the puzzle. See this discussion here: |
@haynesjm42 the lib https://www.npmjs.com/package/@seznam/compose-react-refs is pretty cool. |
We have added composeRefs to develop, so we should now have all the tools we need to work on this. |
Think we are now all familiar with the composeRefs tool, which has been great to let us wrangle external and internal refs whenever we need to and was looking to close this out, Certainly for mobile But I see that for the most part, our big signature components with corresponding Models -- Grid, DataView, DashContainer, Form, DockContainer, Chart,FilterChooser, GroupingChooser do not actually pass a forwardRef to the component they use for internal rendering. I think it would be straightforward to do this, but I just want to make sure we want to? Is this for purpose of this to be able to get a Dom element for aligning things to these components or scrolling to them etc without putting them in other containers. The reason I ask is that another option (and I know it sounds crazy) would be to somehow have the ref that is returned from these components be an imperative handle to the model of the component in question. That would be another "big" way of structuring apps, that I don' think we want to introduce, but just wanted to confirm here before we preclude it. |
Grid does not forward its ref, and to make things even more complicated it already gets a ref to its outer frame for its own use. This library looks promising for dealing with assigning multiple refs to the same DOM element: https://www.npmjs.com/package/@seznam/compose-react-refs
Mobile panel is another component which does not forward refs. We need to audit all components to ensure we are forwarding appropriately.
See https://github.com/xh/hoist-react/compare/gridRef for an example of using that library for dealing with multiple refs.
The text was updated successfully, but these errors were encountered: