Skip to content

Commit c66728d

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Add ButtonProps export (facebook#49593)
Summary: Pull Request resolved: facebook#49593 Changelog: [Internal] Reviewed By: huntie Differential Revision: D69984581 fbshipit-source-id: 1a9607866dee564718081a15f9f6740dfb8dd0e4
1 parent 8bce4a3 commit c66728d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/react-native/Libraries/Components/Button.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import View from './View/View';
2727
import invariant from 'invariant';
2828
import * as React from 'react';
2929

30-
type ButtonProps = $ReadOnly<{
30+
export type ButtonProps = $ReadOnly<{
3131
/**
3232
Text to display inside the button. On Android the given title will be
3333
converted to the uppercased form.
@@ -286,7 +286,7 @@ const Touchable: typeof TouchableNativeFeedback | typeof TouchableOpacity =
286286
type ButtonRef = React.ElementRef<typeof Touchable>;
287287

288288
const Button: component(
289-
ref: React.RefSetter<ButtonRef>,
289+
ref?: React.RefSetter<ButtonRef>,
290290
...props: ButtonProps
291291
) = React.forwardRef((props: ButtonProps, ref: React.RefSetter<ButtonRef>) => {
292292
const {

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ declare export default typeof ActivityIndicatorViewNativeComponent;
14071407
`;
14081408

14091409
exports[`public API should not change unintentionally Libraries/Components/Button.js 1`] = `
1410-
"type ButtonProps = $ReadOnly<{
1410+
"export type ButtonProps = $ReadOnly<{
14111411
title: string,
14121412
onPress: (event?: GestureResponderEvent) => mixed,
14131413
touchSoundDisabled?: ?boolean,
@@ -1440,7 +1440,7 @@ declare const Touchable:
14401440
| typeof TouchableOpacity;
14411441
type ButtonRef = React.ElementRef<typeof Touchable>;
14421442
declare const Button: component(
1443-
ref: React.RefSetter<ButtonRef>,
1443+
ref?: React.RefSetter<ButtonRef>,
14441444
...props: ButtonProps
14451445
);
14461446
declare export default typeof Button;

scripts/build/build-types/buildTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const ENTRY_POINTS = [
3737
'packages/react-native/Libraries/Blob/URLSearchParams.js',
3838
'packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js',
3939
'packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js',
40+
'packages/react-native/Libraries/Components/Button.js',
4041
'packages/react-native/Libraries/Components/Clipboard/Clipboard.js',
4142
'packages/react-native/Libraries/Components/LayoutConformance/LayoutConformance.js',
4243
'packages/react-native/Libraries/Components/ToastAndroid/ToastAndroid.js',

0 commit comments

Comments
 (0)