diff --git a/packages/react-native-reanimated/__typetests__/common/miscTest.tsx b/packages/react-native-reanimated/__typetests__/common/miscTest.tsx index b3ac7f3b48d9..2fb62199992d 100644 --- a/packages/react-native-reanimated/__typetests__/common/miscTest.tsx +++ b/packages/react-native-reanimated/__typetests__/common/miscTest.tsx @@ -1,14 +1,10 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { - createAnimatedPropAdapter, Easing, interpolateColor, isSharedValue, Keyframe, makeMutable, - useAnimatedProps, - useAnimatedStyle, useSharedValue, } from '../..'; @@ -39,19 +35,6 @@ function InterpolateColorTest() { return null; } -function UpdatePropsTest() { - const adapter1 = createAnimatedPropAdapter((props) => {}, []); - const adapter2 = createAnimatedPropAdapter((props) => {}, ['prop1', 'prop2']); - const adapter3 = createAnimatedPropAdapter(() => {}); - - // @ts-expect-error works only for useAnimatedProps - useAnimatedStyle(() => ({}), undefined, [adapter1, adapter2, adapter3]); - - useAnimatedProps(() => ({}), null, adapter1); - - useAnimatedProps(() => ({}), null, [adapter2, adapter3]); -} - function EasingFactoryFunctionTest() { const easing = Easing.bezier(0.1, 0.7, 1, 0.1); diff --git a/packages/react-native-reanimated/src/PropAdapters.ts b/packages/react-native-reanimated/src/PropAdapters.ts deleted file mode 100644 index 50cfdbaee202..000000000000 --- a/packages/react-native-reanimated/src/PropAdapters.ts +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -import { logger } from './common'; -import type { - AnimatedPropsAdapterFunction, - AnimatedPropsAdapterWorklet, -} from './commonTypes'; - -// @ts-expect-error This overload is required by our API. -export function createAnimatedPropAdapter( - adapter: AnimatedPropsAdapterFunction, - nativeProps?: string[] -): AnimatedPropsAdapterFunction; - -export function createAnimatedPropAdapter( - adapter: AnimatedPropsAdapterWorklet, - _nativeProps?: string[] -): AnimatedPropsAdapterWorklet { - logger.warn( - '`createAnimatedPropAdapter` is no longer necessary in Reanimated 4 and will be removed in next version. Please remove this call from your code and pass the adapter function directly.' - ); - return adapter; -} diff --git a/packages/react-native-reanimated/src/commonTypes.ts b/packages/react-native-reanimated/src/commonTypes.ts index bd6259bfc20d..6c2e82d383dd 100644 --- a/packages/react-native-reanimated/src/commonTypes.ts +++ b/packages/react-native-reanimated/src/commonTypes.ts @@ -6,7 +6,7 @@ import type { TransformsStyle, ViewStyle, } from 'react-native'; -import type { SerializableRef, WorkletFunction } from 'react-native-worklets'; +import type { SerializableRef } from 'react-native-worklets'; import type { CSSAnimationProperties, CSSTransitionProperties } from './css'; import type { EasingFunctionFactory } from './Easing'; @@ -227,15 +227,6 @@ export type MapperRegistry = { stop: (mapperID: number) => void; }; -export type AnimatedPropsAdapterFunction = ( - props: Record -) => void; - -export type AnimatedPropsAdapterWorklet = WorkletFunction< - [props: Record], - void ->; - export interface NestedObject { [key: string]: NestedObjectValues; } diff --git a/packages/react-native-reanimated/src/hook/commonTypes.ts b/packages/react-native-reanimated/src/hook/commonTypes.ts index 0c26a775d2e1..a2d2dcb8811d 100644 --- a/packages/react-native-reanimated/src/hook/commonTypes.ts +++ b/packages/react-native-reanimated/src/hook/commonTypes.ts @@ -9,11 +9,7 @@ import type { } from 'react-native'; import type { WorkletFunction } from 'react-native-worklets'; -import type { - AnimatedPropsAdapterFunction, - AnimatedStyle, - ShadowNodeWrapper, -} from '../commonTypes'; +import type { AnimatedStyle, ShadowNodeWrapper } from '../commonTypes'; import type { AnimatedProps } from '../createAnimatedComponent/commonTypes'; import type { ReanimatedHTMLElement } from '../ReanimatedModule/js-reanimated'; import type { ViewDescriptorsSet } from '../ViewDescriptorsSet'; @@ -108,9 +104,5 @@ export interface JestAnimatedStyleHandle< export type UseAnimatedStyleInternal