Questions tagged [react-navigation-v5]
729 questions
0
votes
1 answer
Prevent to running common events in React Navigation stack screens

Mahdi Bashirpour
- 17,147
- 12
- 117
- 144
0
votes
1 answer
Clearing stack on navigating
On react-navigation v4, I was able to clear the stack navigation where navigating to a screen in a stacknavigator with this code :
this.props.navigation.dispatch(StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({…
0
votes
1 answer
this.props.navigation.state.params is undefined
My code worked without problem with react navigation V3, but following an update to version 5.
I had a piece of code to get the name of the route of the active screen, but following an update to version V5, this.props.navigation.state.params is…

FOKO THierry
- 241
- 3
- 12
0
votes
0 answers
Problem in converting React Navigation v3 to v5
Can someone help me how to convert this to the v5 syntax?
const Navigator = createSwitchNavigator(
{
[screens.App]: AppNavigator,
},
{
initialRouteName: screens.Init,
headerMode: 'screen',
},
);
const RootNavigator =…
0
votes
1 answer
Reac-navigation 5 with AuthContext and 2 Stack Navigator : loop and flash screens
Here is the main app (Expo sdk36 with react-navigation 5) :
console.log('New stateNavigation is',…

Laurent Roger
- 198
- 1
- 9
0
votes
1 answer
React Navigation 5 - createNativeStackNavigator with custom header
I'm using React navigation 5 on react native application. I try to use NativeStackNavigator with custom header. With React navigation 4 it's worked but no with 5.
React navigation 4:
import { createStackNavigator } from…

Thomas Gicquel
- 41
- 1
- 6
0
votes
1 answer
how to solve "null is not object(evaluating RNGestureHandlerModule.default.direction" in react native 5.0
I have installed all the dependencies according to the react navigation docs.. when I copied code from docs this error occurs..
my dependencies are
"dependencies": {
"@react-native-community/masked-view": "^0.1.6",
…

Arun.k
- 165
- 1
- 2
- 11
0
votes
3 answers
React Navigation 5 - Native Stack Navigator with custom header which has a searchbar
I'm currently in a project for which we are using React Navigation 5 with the native stack navigator due to its increased performance. We are needing to add a searchbar to the header cause the client isn't gonna like it to be somewhere else. Is…

Dieguinho
- 758
- 2
- 14
- 31
0
votes
2 answers
How to avoid unexpected rendering while using React Context?
I have two functional component under my provider,
SubApp1 and SubApp2 and here when I am increasing counter1 in SubApp1 the SubApp2 also is rendering, even when it is not need to be re-rendered.
And when I am increasing counter2 in SubApp2 the…

Muhammad
- 2,572
- 4
- 24
- 46
0
votes
1 answer
(React Navigation 5): Cannot read property 'replace' of undefined
I use version 5 React Navigation.
And according to the React Navigation documentation I use the replace as below
import { StackActions } from '@react-navigation/native';
navigation.dispatch(
StackActions.replace('Profile', {
user: 'jane',
…

Mahdi Bashirpour
- 17,147
- 12
- 117
- 144
0
votes
2 answers
'@react-navigation/stack' has stopped working with error - unable to resolve module
I have been successfully using React Navigation Stack (V5) for about a week now and today my app will not build as the error - unable to resolve module is now shown.
Error Message
The module is installed as shown in my package.json file -
{
…

BlueChip
- 31
- 1
- 6
0
votes
2 answers
How to update previous screen params from current screen in react-navigation 5
In react-navigation 4, I was passing a function as a param to the navigated screen. But in react-navigation 5, this has a warning which is not recommended. So now how can I update params of previous screen from current screen ?
Example:
I am in a…

Muhammad
- 2,572
- 4
- 24
- 46
0
votes
2 answers
how not to return to the previous screen if the user clicks the android back button
Thank you very much in advance.
In the standard state, the stack browser when navigating from one to A to page B, and watching or voting the return of Android it returns to a previous page in the case of A.
code are you running and what is…

Andersonfrfilho
- 130
- 11
0
votes
1 answer
How to pass custom props when using React Navigation version 5?
I have upgraded to React Navigation v5 in my app. I am using watermelondb in my app.
While using ReactNavigationv4, I used to pass the database props as follows
export const createNavigation = props =>
But in v5 do something as
const Stack =…

BraveEvidence
- 53
- 11
- 45
- 119
0
votes
1 answer
Getting default styles when upgrading from React Navigation v4 to v5
I am currently using React Navigation v4 and migrating to v5. I am using the official documentation for the upgrade but unfortunately, I encountered a blocker.
In V4 I can do the following:
export default function ExampleScreen(props) {
return…

dcangulo
- 1,888
- 1
- 16
- 48