I am trying to navigate between two screen with the help of react-navigation
. I am able to access navigate
inside the render
method as
That happens because you are not destructuring it from the props as you have done in your render() function
onPressButton = () => {
var {navigate} = this.props.navigation;
var options = {
title: strings.app_name,
content: strings.create_message,
positiveText: strings.OK,
onPositive: () => navigate("DashboardScreen")
};
var dialog = new DialogAndroid();
dialog.set(options);
dialog.show();
}