Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Pass route name as variable in react naive navigation

$
0
0

I have a screen that used in two navigators and wanna make navigation.navigate to previous screen with passig some data. I've tried something like this:

const {routeNames, index} = useNavigationState(state => state);navigation.navigate(routeNames[index-1], {data: 'some data'})

It does not work and throws error Type 'string' is not assignable to type 'keyof AuthParamList'.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>