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 />

    );
  }
}
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.