Merge pull request #967 from esteemapp/bugfix/android-post-button

Fixed android post button navigation issue
This commit is contained in:
uğur erdal 2019-07-23 19:45:22 +03:00 committed by GitHub
commit c5368a00f0

View File

@ -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);