Closed
Description
I have the following examples:
WORKS
// moving
onPanResponderMove: Animated.event([null, {
dx: this.state.pan.x, // x,y are Animated.Value
dy: this.state.pan.y,
}]),
DOESN'T WORK
// moving
onPanResponderMove: (evt, gestureState) => {
this.props.updatePanPosition(gestureState.moveX, gestureState.moveY)
return Animated.event([null, {
dx: this.state.pan.x,
dy: this.state.pan.y,
}])
},
The pan state is an Animated.ValueXY()
I need to use the onPanResponderMove function to get latest coordinates on the screen and use it in another component
This looks like an issue!
I'm using react-native: 0.47.2
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
xardit commentedon Sep 10, 2017
Never mind, fixed it
Reason was because Animation.event() only generates the function which is used from onPanResponderMove, it also needs the default arguments
evt, gestureState
WORKING CODE