Can we make the same route using the navigator in response mode?

I have a view, say DynamicView . I am trying to click the same view (DynamicView) in a navigator with different parameters.

this.props.navigator.push({
    component: DynamicView,
    params: {} //Different params
})
...
export default connect(mapStateToProps, mapDispatchToProps)(DynamicView)

DynamicView is associated with a reduction stream. But I can not access the last state in the pressed component.

I want to know if this is the right thing to do? If so, how can I access the last state in the pushed component that matches the parent. If not, is there a different approach to dynamically creating a new route.

Any help is appreciated. Thank you

React Native v0.40

+6
1

A React, , , StackNavigator, . React Navigation.

, StackNavigator. - :

export const SimpleApp = StackNavigator({
  MyDynamicView: { screen: DynamicView }
  ... other routes ...
});

React ( DynamicView) MyDynamicView , , :

navigation.navigate('MyDynamicView, { username: 'John' })

navigation.navigate('MyDynamicView, { username: 'John2' })
+3

All Articles