React-Navigation go to same route with different params
You are looking for push instead of navigate. When you use navigate, it look for a route with that name, and if it exists navigate to it. When you use push, you go to a new route, adding a new navigation to the stack.
See the documentation here https://reactnavigation.org/docs/en/navigating.html#navigate-to-a-route-multiple-times
In your case, you should do:
NavigationActions.push({ routeName: 'User', params: {userId} })
or through your props (make sure your props has 'navigation'):
this.props.navigation.push('User', {userId:'paramValue'})
Use the navigation key to navigate to same route
const navigateAction = NavigationActions.navigate({
routeName: 'User',
params: {userId},
key: 'APage' + APageUUID
});
this.props.navigation.dispatch(navigateAction);
OR
this.props.navigation.navigate({
routeName: 'User',
params: {userId},
key: 'APage' + APageUUID
});
APageUUID
is just a unique page id, can be generated with Math.random () * 10000
Reference