0
Hello, I would like to know how I disable the return button of the createMaterialTopTabNavigator, from React-Native, in version 5.
I managed to Disable the native button this way:
import React, {useEffect} from 'react';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
import Agenda from '../pages/agenda';
import Pacientes from '../pages/pacientes';
import Exames from '../pages/exames';
import {BackHandler} from 'react-native';
const Tab = createMaterialTopTabNavigator();
export default function SismedRoutes() {
useEffect(() => {
BackHandler.addEventListener('hardwareBackPress', () => true);
return () =>
BackHandler.removeEventListener('hardwareBackPress', () => true);
}, []);
return (
<Tab.Navigator initialRouteName="Agenda">
<Tab.Screen name="Agenda" component={Agenda} />
<Tab.Screen name="Pacientes" component={Pacientes} />
<Tab.Screen name="Exames" component={Exames} />
</Tab.Navigator>
);
}
Thanks buddy, that’s exactly what I was looking for. Hugs!
– joao vitor