Istvan Orban
Istvan Orban

Reputation: 1685

Redux Native How to navigate with react-navigation-redux-helpers

I would like to know how can I fire navigation actions in React Native (with the react-navigation-redux-helpers) ?

I tired to use NavigationActions.navigate({ routeName: 'App' }) function but nope :(

Upvotes: 0

Views: 827

Answers (2)

maxhungry
maxhungry

Reputation: 1912

react-navigation gives you action creators, see https://reactnavigation.org/docs/en/navigation-actions.html

import { NavigationActions } from 'react-navigation';

const navigateAction = NavigationActions.navigate({
  routeName: 'Profile',

  params: {},

  action: NavigationActions.navigate({ routeName: 'SubProfileRoute' }),
});

this.props.navigation.dispatch(navigateAction);

Upvotes: 2

Giorgos Kartalis
Giorgos Kartalis

Reputation: 994

Try:

this.props.navigation.navigate('ScreenName')

Upvotes: 1

Related Questions