Questions tagged [react-navigation-v5]
729 questions
6
votes
3 answers
Dynamically change header title on react navigation 5.x
I have recently updated my project to react navigation 5.x.
In earlier version we used to set header title as follows :
static navigationOptions = ({ navigation }) => ({
title: 'find',
});
This is not working on React Navigation…

Rizwan
- 3,324
- 3
- 17
- 38
6
votes
1 answer
Navigating to screen in another navigator in React Navigation 5
I'm using the new React Navigation 5 in my React Native app.
The main menu is handled by the RootNavigator which is a Drawer. The login/sign up are handled by AuthNavigation which is a Stack.
I'm trying to send user to Home screen under…

Sam
- 26,817
- 58
- 206
- 383
6
votes
0 answers
IntialParams on a Tab Navigator Screen is undefined (react navigation v5)
I'm trying to pass an initialParam prop to a TabNavigator screen. It is meant to be a login piece of local state, just doing a proof of concept. It works fine with the stack navigator screen, but the route.params on the tab screen is undefined. What…

pianoman102
- 541
- 8
- 22
6
votes
1 answer
How to replace createAppContainer with NavigationContainer? (using compatibility layer module)
I am trying to migrate from v4 to v5, and they've removed createAppContainer and are saying to use NavigationContainer in its place.
I'm using the createCompatNavigatorFactory stuff from the compatibility layer docs.
Before, I'd pass my main…

Swish
- 359
- 4
- 14
5
votes
1 answer
React-navigation switch theme toggle
i've implemented theming support into my app with react-navigation, as you can see below.
i am using the system theme settings, and my app follows this rule
this is working great, but there's one thing left on my to-do list,
a option to toggle…

blendstylez
- 341
- 3
- 16
5
votes
1 answer
How to access NavigatorScreen > options inside Screen component?
Is there any way I could access navigator-screen options object inside Home component ?

Hend El-Sahli
- 6,268
- 2
- 25
- 42
5
votes
1 answer
Custom Drawer in react navigation
In my react native project I have custom drawer with screens like screen1 and screen2. Screen1 is used for stack navigator and in Screen 2 it contains tab navigator. How to enable this kind of nesting navigation.
I am using react navigation 5 in…

Khushi
- 1,759
- 6
- 26
- 45
5
votes
2 answers
Access parent stack navigator's navigation object from nested child screen
I am using React Navigation v5 in my react-native project.
I have a nested stack navigator.
The parent stack navigator MyParentFlow which has a screen component which hosts another stack navigator:
const MyParentFlow = ({route, navigation}) => {
…

Leem.fin
- 40,781
- 83
- 202
- 354
5
votes
0 answers
View flashing when Keyboard appears on React Native Expo Managed Project and Android
I am practicing in React Native and Expo a very basic project. The project does not use ejected projects so I cannot directly interact with the projects of the specific platforms (Android & iOS) and I want it to remain that way.
A few days ago I saw…
user12226022
5
votes
1 answer
How to update material-bottom-tabs badge text without re-rendering all child components?
I have used createMaterialBottomTabNavigator and redux to change badge text. Here is the code:
class Router extends React.PureComponent {
constructor(props) {
super(props);
this.state = {}
}
componentDidMount() {
…

sina farbod
- 497
- 4
- 17
5
votes
1 answer
Disable back button in a specific Screen (React Navigation Stack)
Hello!
I need to disable the back button on the navigation bar. help me plsss.
Routes
Home: I don't want to leave the application
Success: I don't want to go back to Checkout.
Example: click here
import React from 'react';
import {…

Leonardo Rabelo
- 53
- 1
- 3
5
votes
2 answers
How to use withNavigation in react-navigation v5?
I have a nested component, and I want to use withNavigation in the nested component in react-navigation v5.

learner62
- 520
- 3
- 10
- 26
5
votes
1 answer
How to update header bar from drawer screen
I am using nested navigation. The root navigator is a StackNavigator and child is DrawerNavigator as far as I know there is no way to put a header bar via DrawerNavigator.
So I made it via StackNavigator but I can not update the header title when I…

Muhammed Ozdogan
- 5,341
- 8
- 32
- 53
5
votes
1 answer
Using typescript with useRoute on react navigation v5
I am trying to extract the params as follows using useRoute as follows.
const route = useRoute();
const { params } = route;
const {
id, name,
} = params;
Everything works fine but the linter is highlighting id and namewith the following…

Muljayan
- 3,588
- 10
- 30
- 54
5
votes
4 answers
React Navigation v5: How to get route params of the parent navigator inside the child screen
So I have nested navigators
Main BottomTab.Navigator
Profile Bottom Tab # 1 (Stack.Navigator)
Profile View (Screen)
Followers (Screen)
Following (Top Tab.Navigator)
Pages (Screen)
Groups (Screen)
Feed Bottom Tab # 2 (Stack)
Some other Bottom…

Ayesha Iftikhar
- 1,028
- 2
- 11
- 27