I want to send params with goBack function in react navigation. Here is my code:
const onSelectClick = () => {
props.navigation.goBack({ permissionId: value.id, permissionName: value.name })}
What I get is just undefined
.
I want to send params with goBack function in react navigation. Here is my code:
const onSelectClick = () => {
props.navigation.goBack({ permissionId: value.id, permissionName: value.name })}
What I get is just undefined
.
navigation.dispatch(state => {
const prevRoute = state.routes[state.routes.length - 2];
return CommonActions.navigate({
name: prevRoute.name,
params: {
},
merge: true,
});
});
This is for 6.x react navigation, probably will work in 7.x as well. This emulates goBack(params); No need for passing previousScreen as parametar.