From 041b4c3dd0529e09518df28bc5cd31ed7964d59e Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 2 Oct 2025 13:47:40 -0700 Subject: [PATCH] Replace `React.ElementProps` with `React.ElementConfig` in `createAnimatedComponent.js` (#54034) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54034 `React.ElementConfig` is often the better choice. See https://flow.org/en/docs/react/types/#toc-react-elementprops Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D83750127 fbshipit-source-id: 788169d73cccc2ed7c9b250845ad7277fe79c47f --- .../Libraries/Animated/createAnimatedComponent.js | 2 +- packages/react-native/ReactNativeApi.d.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/Animated/createAnimatedComponent.js b/packages/react-native/Libraries/Animated/createAnimatedComponent.js index f9970a1cc31..11b2ce8d792 100644 --- a/packages/react-native/Libraries/Animated/createAnimatedComponent.js +++ b/packages/react-native/Libraries/Animated/createAnimatedComponent.js @@ -97,7 +97,7 @@ export default function createAnimatedComponent< >( Component: TInstance, ): AnimatedComponentType< - $ReadOnly>, + $ReadOnly>, React.ElementRef, > { return unstable_createAnimatedComponentWithAllowlist(Component, null); diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 7771f1d4193..2ac82083cbf 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<<575e58047a8edf6bbc016768775a258f>> + * @generated SignedSource<<4e0d1f9ebc86fb237989b7099bf6f9df>> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -1920,7 +1920,12 @@ declare function createAnimatedComponent_default< >( Component: TInstance, ): AnimatedComponentType< - Readonly>, + Readonly< + React.JSX.LibraryManagedAttributes< + TInstance, + React.ComponentProps + > + >, React.ComponentRef > declare function createLayoutAnimation(