MCPcopy Create free account
hub / github.com/dabbott/react-native-express / App

Function App

examples/files/gestures/panResponder.js:6–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import usePanResponder from './usePanResponder'
5
6export default function App() {
7 const [state, panHandlers] = usePanResponder()
8
9 const { dragging, initialY, initialX, offsetY, offsetX } = state
10
11 const style = {
12 backgroundColor: dragging ? '#2DC' : '#0BA',
13 transform: [
14 { translateX: initialX + offsetX },
15 { translateY: initialY + offsetY },
16 ],
17 }
18
19 return (
20 <View style={styles.container}>
21 <View
22 // Put all panHandlers into the View's props
23 {...panHandlers}
24 style={[styles.square, style]}
25 >
26 <Text style={styles.text}>DRAG ME</Text>
27 </View>
28 </View>
29 )
30}
31
32const styles = StyleSheet.create({
33 container: {

Callers

nothing calls this directly

Calls 1

usePanResponderFunction · 0.85

Tested by

no test coverage detected