Skip to content

Commit 2c721ef

Browse files
chore: add touchableRef to Button (#4322)
1 parent aaa46eb commit 2c721ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/Button/Button.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
139139
* @optional
140140
*/
141141
theme?: ThemeProp;
142+
/**
143+
* Reference for the touchable
144+
*/
145+
touchableRef?: React.RefObject<View>;
142146
/**
143147
* testID to be used on tests.
144148
*/
@@ -191,6 +195,7 @@ const Button = (
191195
accessible,
192196
background,
193197
maxFontSizeMultiplier,
198+
touchableRef,
194199
...rest
195200
}: Props,
196201
ref: React.ForwardedRef<View>
@@ -348,6 +353,7 @@ const Button = (
348353
style={touchableStyle}
349354
testID={testID}
350355
theme={theme}
356+
ref={touchableRef}
351357
>
352358
<View style={[styles.content, contentStyle]}>
353359
{icon && loading !== true ? (

0 commit comments

Comments
 (0)