'use strict'; import { useEffect, useRef } from 'react'; import type { WorkletFunction } from 'react-native-worklets'; import { makeShareable } from 'react-native-worklets'; import { initialUpdaterRun } from '../animation'; import { logger } from '../common'; import type { AnimatedPropsAdapterWorklet } from '../commonTypes'; import { startMapper, stopMapper } from '../core'; import type { AnimatedProps } from '../createAnimatedComponent/commonTypes'; import { makeViewDescriptorsSet } from '../ViewDescriptorsSet'; import type { AnimatedStyleHandle, DefaultStyle, DependencyList, } from './commonTypes'; import type { AnimatedUpdaterData } from './useAnimatedStyleCommon'; import { buildWorkletsHash, checkSharedValueUsage, createAnimatedStyleHandle, styleUpdater, } from './useAnimatedStyleCommon'; import { useSharedValue } from './useSharedValue'; import { validateAnimatedStyles } from './utils'; /** * Lets you create a styles object, similar to StyleSheet styles, which can be * animated using shared values. * * @param updater - A function returning an object with style properties you * want to animate. * @param dependencies - An optional array of dependencies. * @returns An animated style object which has to be passed to the `style` * property of an Animated component you want to animate. * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle */ // @ts-expect-error Public type definition which strips internals. export function useAnimatedStyle