How to know which route I am with react-navigation in react-native? [closed]

0

I am using a Rea-navigation StackNavigation in react-native, but I need my header component to be very personalized according to the route, I will place the custom heade component, but I can not get the name of the route I am on or something that identifies it in the header.

    
asked by Johnny Pachecp 04.05.2018 в 23:49
source

1 answer

1

Very easy, with this line:

this.props.navigate.state.key

It will return a string with the name of the current route.

    
answered by 05.05.2018 / 17:28
source