I'm currently using React Navigation 5.x and I have a modal that swipes downward to close and it has ScrollView on it. The problem is, since the content can be scrolled by gesturing downward, the modal is sometimes accidentally closed. So I want to dynamically disable gestureEnabled to false until onScrollToTop indicates that the ScrollView has reached the top.
<Main.Navigator
tabBarPosition="none"
initialRouteName="Main"
screenOptions={{
headerShown: false,
gestureEnabled: true,
gestureResponseDistance: {
horizontal: width,
vertical: height,
},
}}
mode="modal"
headerMode="none">
// screens
</Main.Navigator>
How do I pass props to screenOptions to disable gestureEnabled dynamically? Or is there a better way of resolving this?