From 2ec438d76fbc33873b3e3c9c67db4447e27d465c Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Tue, 23 Jul 2019 16:12:13 +0300 Subject: [PATCH] Fixed android post button navigation issue --- .../postButton/view/postButtonsForAndroid.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/postButton/view/postButtonsForAndroid.js b/src/components/postButton/view/postButtonsForAndroid.js index 1d41e105f..22995c73a 100644 --- a/src/components/postButton/view/postButtonsForAndroid.js +++ b/src/components/postButton/view/postButtonsForAndroid.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Animated, Easing, View } from 'react-native'; import { connect } from 'react-redux'; -import { withNavigation } from 'react-navigation'; +import { NavigationActions } from 'react-navigation'; // Components import SubPostButton from './subPostButtonView'; @@ -95,14 +95,13 @@ class PostButtonsForAndroid extends Component { }; _handleSubButtonPress = (route, action) => { - const { navigation } = this.props; - - navigation.navigate({ + const { dispatch } = this.props; + const navigateAction = NavigationActions.navigate({ routeName: route, - params: { - action, - }, + params: { action }, + action: NavigationActions.navigate({ routeName: route }), }); + dispatch(navigateAction); }; render() { @@ -177,4 +176,4 @@ const mapStateToProps = state => ({ isCollapsePostButtonOpen: state.ui.isCollapsePostButton, }); -export default connect(mapStateToProps)(withNavigation(PostButtonsForAndroid)); +export default connect(mapStateToProps)(PostButtonsForAndroid);