Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

89
Visualizações
React Native Web navigation route issue

I'm building a RN App and also building it for web with RNWeb, but I'm encountering two issues.

First, I need to get rid of some of the names in the route of the url, for example:

In my App.js I have a <NavigationContainer> In which I have a StackNavigator that goes to a screen called Main. In the Main screen, I have a tab navigator with 5 different tab screens. Each of that Screen, is a different StackNavigator that holds multiple StackScreens depending on the context of the TabNavigator Screen (Ex: Settings on tab navigator will hold the StackSettings.Navigator and inside that will reside AppSettings screen component. But the problem is, they show up in the url, for example: http://app.com/StackSettings/AppSettings instead of http://app.com/AppSettings or http://app.com/StackHome/Home instead of http://app.com/Home

TLDR: I have stacked navigations inside each tab navigation and url shows like this: http://app.com/StackNavigatorName/StackScreenName instead of http://app.com/StackScreenName

And the 2nd issue I'm encountering, if I go to another Tab Navigator(therefore another StackNavigator) and go back to the old one(use back or choose it from tab nav) I cannot click on anything on it.

Code:

App.js

 <NavigationContainer linking={{
            prefixes: ["localhost"],
            config:{
              screens:{
                Main: {
                  path: '/',
                },
              },
            },
          }}
        >
        
          <Stack.Navigator initialRouteName="Main" >
            <Stack.Screen name="Main" component"Main">
          </Stack.Navigator>
</NavigationContainer>
        

Main.js

const StackNavigatorHome = () => (
    <StackHome.Navigator initialRoute="Home">
            <StackHome.Screen name="Home" component={Home}/>
            <StackHome.Screen name="Create" component={Create}/>
    </StackHome.Navigator>
)


const StackNavigatorSettings = () => (
    <StackSettings.Navigator initialRoute="Settings">
            <StackSettings.Screen name="Settings" component={Settings}/>
            <StackSettings.Screen name="AppSettings" component={AppSettings}/>
    </StackSettings.Navigator>
)

return(
<Tab.Navigator >
    <Tab.Screen name="StackHome" component={StackNavigatorHome} />
    <Tab.Screen name="StackSettings" component={StackNavigatorSettings} />
</Tab.Navigator>
)
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda