Replace $Diff with Omit in react-native (#50603)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50603

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D72740500

fbshipit-source-id: 829a51dfbdb597fec8b3cca29364a67158a8dd2a
This commit is contained in:
Sam Zhou
2025-04-09 17:38:01 -07:00
committed by Facebook GitHub Bot
parent f86de9724b
commit 178febd0aa
6 changed files with 10 additions and 10 deletions
@@ -70,7 +70,7 @@ export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
export type NativeProps = $ReadOnly<{
// This allows us to inherit everything from ViewProps except for style (see below)
// This must be commented for Fabric codegen to work.
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
...Omit<ViewProps, 'style'>,
/**
* Android props after this
@@ -1008,7 +1008,7 @@ type TextInputBaseProps = $ReadOnly<{
}>;
export type TextInputProps = $ReadOnly<{
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
...Omit<ViewProps, 'style'>,
...TextInputIOSProps,
...TextInputAndroidProps,
...TextInputBaseProps,
@@ -225,5 +225,5 @@ export default (React.forwardRef((props, hostRef: React.RefSetter<mixed>) => (
<TouchableBounce {...props} hostRef={hostRef} />
)): component(
ref: React.RefSetter<mixed>,
...props: $ReadOnly<$Diff<TouchableBounceProps, {hostRef: mixed}>>
...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
));
@@ -407,7 +407,7 @@ class TouchableHighlightImpl extends React.Component<
const TouchableHighlight: component(
ref?: React.RefSetter<React.ElementRef<typeof View>>,
...props: $ReadOnly<$Diff<TouchableHighlightProps, {+hostRef: mixed}>>
...props: $ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>
) = React.forwardRef((props, hostRef) => (
<TouchableHighlightImpl {...props} hostRef={hostRef} />
));
+1 -1
View File
@@ -129,7 +129,7 @@ export type ImagePropsAndroid = $ReadOnly<{
}>;
export type ImagePropsBase = $ReadOnly<{
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
...Omit<ViewProps, 'style'>,
/**
* When true, indicates the image is an accessibility element.
*
@@ -2413,7 +2413,7 @@ export type ReturnKeyType =
| \\"yahoo\\";
export type SubmitBehavior = \\"submit\\" | \\"blurAndSubmit\\" | \\"newline\\";
export type NativeProps = $ReadOnly<{
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
...Omit<ViewProps, \\"style\\">,
autoComplete?: WithDefault<
| \\"birthdate-day\\"
| \\"birthdate-full\\"
@@ -2955,7 +2955,7 @@ type TextInputBaseProps = $ReadOnly<{
value?: ?Stringish,
}>;
export type TextInputProps = $ReadOnly<{
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
...Omit<ViewProps, \\"style\\">,
...TextInputIOSProps,
...TextInputAndroidProps,
...TextInputBaseProps,
@@ -3240,7 +3240,7 @@ exports[`public API should not change unintentionally Libraries/Components/Touch
}>;
declare export default component(
ref: React.RefSetter<mixed>,
...props: $ReadOnly<$Diff<TouchableBounceProps, { hostRef: mixed }>>
...props: $ReadOnly<Omit<TouchableBounceProps, \\"hostRef\\">>
);
"
`;
@@ -3273,7 +3273,7 @@ export type TouchableHighlightProps = $ReadOnly<{
}>;
declare const TouchableHighlight: component(
ref?: React.RefSetter<React.ElementRef<typeof View>>,
...props: $ReadOnly<$Diff<TouchableHighlightProps, { +hostRef: mixed }>>
...props: $ReadOnly<Omit<TouchableHighlightProps, \\"hostRef\\">>
);
declare export default typeof TouchableHighlight;
"
@@ -4323,7 +4323,7 @@ export type ImagePropsAndroid = $ReadOnly<{
resizeMultiplier?: ?number,
}>;
export type ImagePropsBase = $ReadOnly<{
...$Diff<ViewProps, $ReadOnly<{ style: ?ViewStyleProp }>>,
...Omit<ViewProps, \\"style\\">,
accessible?: ?boolean,
internal_analyticTag?: ?string,
accessibilityLabel?: ?Stringish,