Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter to panHandlers to handle multiple PanResponder?

Tags:

react-native

Let say I have two simple animated view. I want to know which View is getting panned. How do I pass any parameter to it or any other way to detect? Thanks

<Animated.View {...this._panResponder.panHandlers}></Animated.View>
<Animated.View {...this._panResponder.panHandlers}></Animated.View>
like image 763
cjmling Avatar asked Nov 26 '22 03:11

cjmling


1 Answers

//passing parameters
<Animated.View {...this._PanResponder('pass parameter here 1').panHandlers}></Animated.View>
<Animated.View {...this._PanResponder('pass parameter here 2').panHandlers}></Animated.View>
//handler
panResponder = (receive parameter here) =>
PanResponder.create({ 
//code here
.
.
.
})
like image 138
Khan Muhammad Avatar answered Feb 23 '23 14:02

Khan Muhammad