Wanna make only Map component swipe-disabled but the entire screens were applied when using "swipeEnabled".
How can I do?
const Tab = createMater
You could pass a state value to swipeEnabled
and update the value to false
if you're on the Map
screen like this:
const Tab = createMaterialTopTabNavigator();
const Tabs = () => {
const [swipeEnabled, setSwipeEnabled] = useState(true);
return (
{
if (route.name === 'Map' && navigation.isFocused()) {
setSwipeEnabled(false);
} else if (route.name !== 'Map' && navigation.isFocused()) {
setSwipeEnabled(true);
}
}}>
);
};