UNPKG

364 BTypeScriptView Raw
1import * as React from 'react';
2
3import StackGestureRefContext from './GestureHandlerRefContext';
4
5export default function useGestureHandlerRef() {
6 const ref = React.useContext(StackGestureRefContext);
7
8 if (ref === undefined) {
9 throw new Error(
10 "Couldn't find a ref for gesture handler. Are you inside a screen in Stack?"
11 );
12 }
13
14 return ref;
15}