-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[withWidth] Broken innerRef property #12518
Comments
@oliviertassinari as you mentioned, using I suggest an enhancement on the current |
@alimo I understand your suggestion but I don't think that it worth pushing the story forward. I think that we should go the other way around, cleaning the property from the component. v2 should come by early 2019. People should avoid relying on ref as much as possible. If you have this requirement, surely you are doing something custom, you should be willing to make your own ref forwarding logic. This issue isn't a blocker, there are ways to workaround it. |
@oliviertassinari You're right. It would make things more complicated than it should be. Thank you for your response. Keep up the good work 😊 |
As it was raised in #12518 this property isn't doing anything, withTheme is taking precedence.
Regarding #12216,
innerRef
property was implemented forwithWidth
andwithTheme
HOCs. But sincewithWidth
itself useswithTheme
as its wrapper,innerRef
will not be propagated through both of them.Since we're not using
forwardRef
API at the moment (#10825 (comment)), i think we should come up with a solution for the existing HOCs to forward theinnerRef
property.A solution would be to add an
options
argument towithTheme
to set an optional flag (likeforwardInnerRef
) so theinnerRef
property provided toWithTheme
component would be forwarded to the wrapped component (WithWidth
in this case) as itsinnerRef
property.Expected Behavior
We should be able to access the component wrapped with
withWidth
.Current Behavior
By using
innerRef
, we get theWithWidth
component.Steps to Reproduce
(See console output)
Your Environment
The text was updated successfully, but these errors were encountered: