Search code examples
typescriptreact-nativereact-native-reanimated

getting type error for style transform properties when with react-native-reanimated


I'm using "react-native": "0.59.10" "react-native-reanimated": "^1.3.0" with typescript I'm getting type error for transform properties

const Example = () => {
  const { translationX, gestureHandler } = horizontalPanGestureHandler()
  return (
    <View style={styles.container}>
      <PanGestureHandler {...gestureHandler}>
        <Animated.View style={{ transform: [{ translateX: translationX }] }} />
      </PanGestureHandler>
    </View>
  )
}

Here's the error I'm gettingType error


Solution

  • You can just update react-native-reanimated to latest version (currently 1.13.0) and problem with style and transform will disappear.