From 729814d5b74212d9e2a828ca80e22f4f576ce4ce Mon Sep 17 00:00:00 2001 From: Evan Bacon Date: Fri, 3 Jan 2020 05:53:12 -0800 Subject: [PATCH] fix all transform errors in the example (#535) --- Example/Interactable.js | 6 ++---- Example/chatHeads/index.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Example/Interactable.js b/Example/Interactable.js index 2f3f224ad83..0e6e09bcba8 100644 --- a/Example/Interactable.js +++ b/Example/Interactable.js @@ -474,10 +474,8 @@ class Interactable extends Component { style, { transform: [ - { - translateX: verticalOnly ? 0 : this._transX, - translateY: horizontalOnly ? 0 : this._transY, - }, + { translateX: verticalOnly ? 0 : this._transX }, + { translateY: horizontalOnly ? 0 : this._transY }, ], }, ]}> diff --git a/Example/chatHeads/index.js b/Example/chatHeads/index.js index 285e60b1984..82b0cd29913 100644 --- a/Example/chatHeads/index.js +++ b/Example/chatHeads/index.js @@ -1,8 +1,7 @@ import React, { Component } from 'react'; -import { Dimensions, Image, View, StyleSheet } from 'react-native'; -import Animated from 'react-native-reanimated'; - +import { Dimensions, StyleSheet, View } from 'react-native'; import { PanGestureHandler, State } from 'react-native-gesture-handler'; +import Animated from 'react-native-reanimated'; const { width } = Dimensions.get('window'); @@ -63,14 +62,12 @@ class Tracking extends Component { const gestureState = new Value(-1); const dragVX = new Value(0); - const dragVY = new Value(0); this._onGestureEvent = event([ { nativeEvent: { translationX: dragX, velocityX: dragVX, - velocityY: dragVY, state: gestureState, translationY: dragY, }, @@ -166,7 +163,8 @@ class Tracking extends Component { styles.box, { transform: [ - { translateX: this.follow3x, translateY: this.follow3y }, + { translateX: this.follow3x }, + { translateY: this.follow3y }, ], }, ]} @@ -179,7 +177,8 @@ class Tracking extends Component { styles.box, { transform: [ - { translateX: this.follow2x, translateY: this.follow2y }, + { translateX: this.follow2x }, + { translateY: this.follow2y }, ], }, ]} @@ -193,7 +192,8 @@ class Tracking extends Component { styles.box, { transform: [ - { translateX: this.follow1x, translateY: this.follow1y }, + { translateX: this.follow1x }, + { translateY: this.follow1y }, ], }, ]} @@ -211,7 +211,8 @@ class Tracking extends Component { styles.box, { transform: [ - { translateX: this._transX, translateY: this._transY }, + { translateX: this._transX }, + { translateY: this._transY }, ], }, ]}