Skip to content

Commit 178febd

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Replace $Diff with Omit in react-native (#50603)
Summary: Pull Request resolved: #50603 Changelog: [Internal] Reviewed By: gkz Differential Revision: D72740500 fbshipit-source-id: 829a51dfbdb597fec8b3cca29364a67158a8dd2a
1 parent f86de97 commit 178febd

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

packages/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
7070
export type NativeProps = $ReadOnly<{
7171
// This allows us to inherit everything from ViewProps except for style (see below)
7272
// This must be commented for Fabric codegen to work.
73-
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
73+
...Omit<ViewProps, 'style'>,
7474

7575
/**
7676
* Android props after this

packages/react-native/Libraries/Components/TextInput/TextInput.flow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ type TextInputBaseProps = $ReadOnly<{
10081008
}>;
10091009

10101010
export type TextInputProps = $ReadOnly<{
1011-
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
1011+
...Omit<ViewProps, 'style'>,
10121012
...TextInputIOSProps,
10131013
...TextInputAndroidProps,
10141014
...TextInputBaseProps,

packages/react-native/Libraries/Components/Touchable/TouchableBounce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,5 @@ export default (React.forwardRef((props, hostRef: React.RefSetter<mixed>) => (
225225
<TouchableBounce {...props} hostRef={hostRef} />
226226
)): component(
227227
ref: React.RefSetter<mixed>,
228-
...props: $ReadOnly<$Diff<TouchableBounceProps, {hostRef: mixed}>>
228+
...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
229229
));

packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class TouchableHighlightImpl extends React.Component<
407407

408408
const TouchableHighlight: component(
409409
ref?: React.RefSetter<React.ElementRef<typeof View>>,
410-
...props: $ReadOnly<$Diff<TouchableHighlightProps, {+hostRef: mixed}>>
410+
...props: $ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>
411411
) = React.forwardRef((props, hostRef) => (
412412
<TouchableHighlightImpl {...props} hostRef={hostRef} />
413413
));

packages/react-native/Libraries/Image/ImageProps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export type ImagePropsAndroid = $ReadOnly<{
129129
}>;
130130

131131
export type ImagePropsBase = $ReadOnly<{
132-
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
132+
...Omit<ViewProps, 'style'>,
133133
/**
134134
* When true, indicates the image is an accessibility element.
135135
*

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,7 +2413,7 @@ export type ReturnKeyType =
24132413
| \\"yahoo\\";
24142414
export type SubmitBehavior = \\"submit\\" | \\"blurAndSubmit\\" | \\"newline\\";
24152415
export type NativeProps = $ReadOnly<{
2416-
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
2416+
...Omit<ViewProps, \\"style\\">,
24172417
autoComplete?: WithDefault<
24182418
| \\"birthdate-day\\"
24192419
| \\"birthdate-full\\"
@@ -2955,7 +2955,7 @@ type TextInputBaseProps = $ReadOnly<{
29552955
value?: ?Stringish,
29562956
}>;
29572957
export type TextInputProps = $ReadOnly<{
2958-
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
2958+
...Omit<ViewProps, \\"style\\">,
29592959
...TextInputIOSProps,
29602960
...TextInputAndroidProps,
29612961
...TextInputBaseProps,
@@ -3240,7 +3240,7 @@ exports[`public API should not change unintentionally Libraries/Components/Touch
32403240
}>;
32413241
declare export default component(
32423242
ref: React.RefSetter<mixed>,
3243-
...props: $ReadOnly<$Diff<TouchableBounceProps, { hostRef: mixed }>>
3243+
...props: $ReadOnly<Omit<TouchableBounceProps, \\"hostRef\\">>
32443244
);
32453245
"
32463246
`;
@@ -3273,7 +3273,7 @@ export type TouchableHighlightProps = $ReadOnly<{
32733273
}>;
32743274
declare const TouchableHighlight: component(
32753275
ref?: React.RefSetter<React.ElementRef<typeof View>>,
3276-
...props: $ReadOnly<$Diff<TouchableHighlightProps, { +hostRef: mixed }>>
3276+
...props: $ReadOnly<Omit<TouchableHighlightProps, \\"hostRef\\">>
32773277
);
32783278
declare export default typeof TouchableHighlight;
32793279
"
@@ -4323,7 +4323,7 @@ export type ImagePropsAndroid = $ReadOnly<{
43234323
resizeMultiplier?: ?number,
43244324
}>;
43254325
export type ImagePropsBase = $ReadOnly<{
4326-
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
4326+
...Omit<ViewProps, \\"style\\">,
43274327
accessible?: ?boolean,
43284328
internal_analyticTag?: ?string,
43294329
accessibilityLabel?: ?Stringish,

0 commit comments

Comments
 (0)