Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/react-native/Libraries/Components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ type ButtonProps = $ReadOnly<{|
```
*/

const Button: React.AbstractComponent<ButtonProps> = (props: ButtonProps) => {
const Button: React.AbstractComponent<
ButtonProps,
React.ElementRef<typeof TouchableNativeFeedback | typeof TouchableOpacity>,
> = React.forwardRef((props: ButtonProps, ref) => {
const {
accessibilityLabel,
accessibilityState,
Expand Down Expand Up @@ -374,15 +377,16 @@ const Button: React.AbstractComponent<ButtonProps> = (props: ButtonProps) => {
testID={testID}
disabled={disabled}
onPress={onPress}
touchSoundDisabled={touchSoundDisabled}>
touchSoundDisabled={touchSoundDisabled}
ref={ref}>
<View style={buttonStyles}>
<Text style={textStyles} disabled={disabled}>
{formattedTitle}
</Text>
</View>
</Touchable>
);
};
});

Button.displayName = 'Button';

Expand Down