-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
Add ref
property to Buttons
#2903
Conversation
src/components/GestureButtons.tsx
Outdated
/** | ||
* Used to pass ref from parent into `BaseButton` | ||
*/ | ||
innerRef?: React.ForwardedRef<unknown>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you mentioned not wanting innerRef
to be accessible, I think we are exporting this type publicly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really think of a solution here that wouldn't need any extensive changes sadly :c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that this doesn't break types, it looks ok to me.
Description
Currently our components (
BaseButton
,RectButton
andBorderlessButton
) don't supportrefs
, so it is impossible to use methods likemeasure
.This PR adds wrapper to these components, so that they are now exported as
ForwardRef
.Fixes #2894
Test plan
Tested on slightly modified code from issue