UNPKG

react-native-reanimated

Version:

More powerful alternative to Animated library for React Native.

16 lines (13 loc) 520 B
'use strict'; import type { Component } from 'react'; import type { StyleProps } from '../commonTypes'; import type { AnimatedRef } from '../hook/commonTypes'; import type { ReanimatedHTMLElement } from '../ReanimatedModule/js-reanimated'; import { _updatePropsJS } from '../ReanimatedModule/js-reanimated'; export function setNativeProps<T extends Component>( animatedRef: AnimatedRef<T>, updates: StyleProps ) { const component = animatedRef() as ReanimatedHTMLElement; _updatePropsJS(updates, component); }