1

I'm using the createStackNavigator to set the navigations, the first top navigation bar does not have the return button, and I'm using it as the login screen. after login I go to the main page of the application, how can I also exclude this return button? and not let the user return?

enter image description here

Is it necessary for me to use the reset function? I add only the login page and main page in the browser and when I enter the main I add the other pages in the browser?

App.js

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import reducers from './src/reducers';
import firebase from 'firebase';
import { createStackNavigator, createMaterialTopTabNavigator } from 'react-navigation';


// Rotas
import FormLogin from "./src/components/FormLogin";
import FormCadastro from "./src/components/FormCadastro";
import FormBoasVindas from "./src/components/BoasVindas";
import FormPrincipal from "./src/components/Principal";
import FormAdicionarContato from "./src/components/AdicionarContato";
import Conversa from "./src/components/Conversa";
// Tab
import ConversasScreen from './src/components/Conversas';
import ContatosScreen from './src/components/Contatos';

const Tab = createMaterialTopTabNavigator(
{
  Conversas: ConversasScreen,
  Contatos: ContatosScreen,
},
{
  tabBarPosition: 'top',
  tabBarOptions: {
    activeTintColor: 'white',
    inactiveTintColor: 'black',
    labelStyle: {
      fontSize: 14,
    },
    style: {
      backgroundColor: '#115E54',
    },
    indicatorStyle: {
      backgroundColor: 'white',
    },
  }
});

const AppNavigator = createStackNavigator({

  FormLoginScreen: { screen: FormLogin },
  FormCadastroScreen: { screen: FormCadastro },
  FormBoasVindasScreen: { screen: FormBoasVindas },

  FormPrincipalScreen: {
    screen: Tab, navigationOptions: () => ({
      title:'WhatsApp',
      headerStyle: {
        backgroundColor: '#115E54',
      },
      headerTintColor: '#fff',
      headerTitleStyle: {
        fontWeight: 'bold',
      },
    }),
  },

  AdicionarContatoScreen: {
    screen: FormAdicionarContato, navigationOptions: () => ({
      title: "Adicionar Contato",
    }),
  },

  ConversaScreen: { screen: Conversa },

});

type Props = {};
export default class App extends Component<Props> {

  render() {
    return (

        <AppNavigator />

    );
  }
}
dentemm
  • 6,231
  • 3
  • 31
  • 43
Emiry Mirella
  • 567
  • 1
  • 7
  • 21
  • 1
    Possible duplicate of [Disable back button in react native navigation](https://stackoverflow.com/questions/42831685/disable-back-button-in-react-native-navigation) – bennygenel Jun 20 '18 at 23:28

0 Answers0