Questions tagged [stack-navigator]

The StackNavigator API provides route configurations and uses navigation options. It can be used to implement custom screen transitions. It comes configured by default to have IOS and Android appearance.

Reference documentation can be found here: StackNavigator reference.

508 questions
35
votes
13 answers

getting undefined is not a function (evaluating '(0,_reactNavigation.stacknavigator)') in drawer navigation

In my application I need drawer navigation, for that I am using sample code from this. I have integrated everything in my application, but getting the following error undefined is not a function (evaluating …
rams
  • 1,558
  • 7
  • 25
  • 48
32
votes
8 answers

React Navigation default background color

I'm using react-navigation and stack-navigator to manage my screens. Platforms I'm using: Android React Native: 0.47.1 React Navigation: 1.0.0-beta.11 Emulator and Device I have a screen, which acts as a modal form but it is really a full screen.…
30
votes
11 answers

`componentDidMount()` function is not called after navigation

I am using stackNavigator for navigating between screens. I am calling two API's in componentDidMount() function in my second activity. When i load it first time, it gets loaded successfully. Then i press back button to go back to first activity.…
hitttt
  • 1,189
  • 4
  • 19
  • 38
30
votes
7 answers

React native clear Stack Navigator stack

I have few screens which I navigate through one by one. Screen1->screen2-screen3->screen4-Home What I want is when I go to home then the previous history of navigation should be cleared and back pressing back button should not go to last navigated…
Paras Watts
  • 2,565
  • 4
  • 21
  • 46
23
votes
9 answers

Unable to resolve "@react-navigation/native" from "App.js" - React Native + How to Solve?

undefined Unable to resolve module @react-navigation/native from App.js: @react-navigation/native could not be found within the project. If you are sure the module exists, try these steps: 1. Clear watchman watches: watchman watch-del-all 2.…
23
votes
10 answers

How to hide header of createStackNavigator on React Native?

I want to hide header because I already have styled Toolbar in code: import {createStackNavigator} from 'react-navigation' const AppStackNavigator = createStackNavigator ({ Home: HomePage, Friend: AddFriend, Bill: AddBill, }) class App extends…
Just Ahead
  • 2,377
  • 6
  • 16
  • 25
17
votes
4 answers

How to change font family in React Navigation createStackNavigator

I use React Navigation as the navigator component of my app. I want to change font family of the stack navigator. Currently I do this to change the font family in iOS and it works pretty well: const LoggedInStack = createStackNavigator({ Home: { …
Banafshe Alipour
  • 1,041
  • 4
  • 12
  • 27
11
votes
6 answers

How to set always first screen of Stack Navigator inside Tab Navigator React Navigation 5

React Navigation 5 I've build a StackNavigator inside of a TabNavigator, and the navigation between home screen and other screens is working. But the problem is,When I move from Tab2 to Tab1 I expect Tab1 always show me first screen of…
osama somy
  • 385
  • 5
  • 16
8
votes
2 answers

How to hide stack navigation header from a single screen in react-navigation v5

My app has 5 components (screens), I am using stack navigation version 5, I need the headers for all screens except one screen, I tried to do this via option inside screens like this: This is my code: const Stack = createStackNavigator(); const…
roz333
  • 695
  • 2
  • 18
  • 30
8
votes
2 answers

React Navigation pass params to nested stackNavigator

In react navigation 3.0 they added the feature to pass default params to screen. The problem is that I want to pass those params to a nested stackNavigator but I can't figure out how to do so. These are my navigators: MainDrawer.js: const…
Leonardo Drici
  • 749
  • 3
  • 11
  • 32
8
votes
4 answers

React Native Logout inside a DrawerNavigator

I want to navigate back from DrawerNav to Login. Using alert('Alert') inside the function is OK. I have a StackNavigator with Login and DrawerNav const MyStackNavigator = StackNavigator({ Login : { screen : Login }, DrawerNav : { screen :…
Maki
  • 319
  • 4
  • 18
8
votes
4 answers

React Native - Passing Data Across Screens

I'm having some trouble with a react-native app. I can't figure out how to pass data across screens. I realize that there are other similar questions that are answered on SO, however the solutions did not work for me. I'm using the StackNavigator.…
Lars Peterson
  • 1,508
  • 1
  • 10
  • 27
8
votes
1 answer

What properties does navigationOptions take in react-native?

There's mention of the property navigationOptions in this page here: https://facebook.github.io/react-native/docs/navigation.html I can't seem to find the full list of properties that navigationOptions is supposed to take? Where do I get this…
John
  • 32,403
  • 80
  • 251
  • 422
7
votes
4 answers

React-navigation: header does not show up when using bottom tab navigator

I am using react-navigation with my react native app. I have created a bottom tab navigator, and want to use the built in header on my screen. But the header is not showing up. There are no errors or warnings. app.js: const TabStack =…
JAM
  • 740
  • 3
  • 15
  • 33
7
votes
4 answers

Hide TabBar item in TabNavigator

How is it possible to hide certain TabBar item from TabNavigator. Is there a certain TabBarOptions option, which has visible key(true/false) like this? const Tabs = TabNavigator({ Home: { screen: Home }, Profile: { screen: Thanks, …
Nikasv
  • 1,317
  • 5
  • 17
  • 33
1
2 3
33 34