我可以在createStackNavigator
import { createStackNavigator, GestureHandlerRefContext } from '@react-navigation/stack';
<GestureHandlerRefContext.Consumer>
{(ref: any) => (
<NativeViewGestureHandler waitFor={ref}>
<ScrollView>...</ScrollView>
</NativeViewGestureHandler>
)}
</GestureHandlerRefContext.Consumer>
我想这样做createNativeStackNavigator
,我怎样才能GestureHandlerRefContext
得到createNativeStackNavigator
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
<GestureHandlerRefContext.Consumer>
{(ref: any) => (
<NativeViewGestureHandler waitFor={ref}>
<ScrollView>...</ScrollView>
</NativeViewGestureHandler>
)}
</GestureHandlerRefContext.Consumer>