diff --git a/packages/react-native/Libraries/Animated/createAnimatedComponent.js b/packages/react-native/Libraries/Animated/createAnimatedComponent.js index 345c1ac29ab..f9970a1cc31 100644 --- a/packages/react-native/Libraries/Animated/createAnimatedComponent.js +++ b/packages/react-native/Libraries/Animated/createAnimatedComponent.js @@ -63,17 +63,29 @@ type PassThroughProps = $ReadOnly<{ passthroughAnimatedPropExplicitValues?: ViewProps | null, }>; -export type AnimatedProps = { - [K in keyof Props]: K extends NonAnimatedProps - ? Props[K] - : WithAnimatedValue, -} & PassThroughProps; +type LooseOmit> = Pick< + O, + Exclude<$Keys, K>, +>; -export type AnimatedBaseProps = { - [K in keyof Props]: K extends NonAnimatedProps - ? Props[K] - : WithAnimatedValue, -}; +export type AnimatedProps = LooseOmit< + { + [K in keyof Props]: K extends NonAnimatedProps + ? Props[K] + : WithAnimatedValue, + }, + 'ref', +> & + PassThroughProps; + +export type AnimatedBaseProps = LooseOmit< + { + [K in keyof Props]: K extends NonAnimatedProps + ? Props[K] + : WithAnimatedValue, + }, + 'ref', +>; export type AnimatedComponentType = component( ref?: React.RefSetter, diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index e1bb4297e72..7771f1d4193 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<69d6b949e011e87bf0e3b81098fed285>> + * @generated SignedSource<<575e58047a8edf6bbc016768775a258f>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -1494,11 +1494,15 @@ declare class AnimatedNode_default { declare type AnimatedNodeConfig = { readonly debugID?: string } -declare type AnimatedProps = { - [K in keyof Props]: K extends NonAnimatedProps - ? Props[K] - : WithAnimatedValue -} & PassThroughProps +declare type AnimatedProps = LooseOmit< + { + [K in keyof Props]: K extends NonAnimatedProps + ? Props[K] + : WithAnimatedValue + }, + "ref" +> & + PassThroughProps declare type AnimatedScrollViewInstance = React.ComponentRef declare class AnimatedSubtraction_default extends AnimatedWithChildren_default { constructor( @@ -3075,6 +3079,10 @@ declare type LoopAnimationConfig = { iterations: number resetBeforeIteration?: boolean } +declare type LooseOmit = Pick< + O, + Exclude +> declare type MacOSPlatform = { OS: "macos" select: (spec: PlatformSelectSpec) => T @@ -5913,7 +5921,7 @@ export { AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 6ad7a14c + Animated, // 6b6a0b2e AppConfig, // ebddad4b AppRegistry, // 6cdee1d6 AppState, // f7097b1b