Skip to content

Commit

Permalink
chore: add touchableRef to Button (#4322)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarNestorov authored Jul 27, 2024
1 parent aaa46eb commit 2c721ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
* @optional
*/
theme?: ThemeProp;
/**
* Reference for the touchable
*/
touchableRef?: React.RefObject<View>;
/**
* testID to be used on tests.
*/
Expand Down Expand Up @@ -191,6 +195,7 @@ const Button = (
accessible,
background,
maxFontSizeMultiplier,
touchableRef,
...rest
}: Props,
ref: React.ForwardedRef<View>
Expand Down Expand Up @@ -348,6 +353,7 @@ const Button = (
style={touchableStyle}
testID={testID}
theme={theme}
ref={touchableRef}
>
<View style={[styles.content, contentStyle]}>
{icon && loading !== true ? (
Expand Down

0 comments on commit 2c721ef

Please sign in to comment.