androidiosreact-nativereact-navigation

How to get current route name in react-navigation?


I want the name of the current route or screen in react-navigation which I want to use inside if condition to make some changes.


Solution

  • You can catch it as the following code:

    this.props.navigation.state.routeName