Using GestureHandler

#1

I’d like to take a shot at implementing pinch-to-zoom in my camera app. I figure GestureHandler will be key to this, but I’m having trouble wrapping my head around how to use it.

How do I enter the DangerZone and gain access to ?

Do I need to follow the installation instructions for react-native-gesture-handler and override createRootView(), or does it work out of the box with Expo? Does that change if I import from react-native-gesture-handler directly?

0 Likes

#2
import { DangerZone } from 'expo';
const { GestureHandler } = DangerZone;

// Grab the components you need
const { FlatList } = GestureHandler;

The components that are exported are:
image

0 Likes

#3

hi there! you can also just import it directly as it’s a transitive dependency of the expo package

import { PanGestureHandler } from 'react-native-gesture-handler';
0 Likes

closed #4

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes