Call react-navigation-redux-helpers's initializeListeners() when mounting app. (#3666)

This makes the first navigation click work correctly, per
https://github.com/react-navigation/react-navigation-redux-helpers/issues/7
This commit is contained in:
Leon Miller-Out
2018-03-05 15:02:34 -05:00
committed by Ashoat Tevosyan
parent 6373b802dd
commit afecaaed7f
2 changed files with 6 additions and 1 deletions

View File

@@ -26,7 +26,7 @@
"react": "16.2.0",
"react-native": "^0.52.0",
"react-navigation": "link:../..",
"react-navigation-redux-helpers": "^1.0.0",
"react-navigation-redux-helpers": "^1.0.3",
"react-redux": "^5.0.6",
"redux": "^3.7.2"
},

View File

@@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { addNavigationHelpers, StackNavigator } from 'react-navigation';
import { initializeListeners } from 'react-navigation-redux-helpers';
import LoginScreen from '../components/LoginScreen';
import MainScreen from '../components/MainScreen';
@@ -20,6 +21,10 @@ class AppWithNavigationState extends React.Component {
nav: PropTypes.object.isRequired,
};
componentDidMount() {
initializeListeners('root', this.props.nav);
}
render() {
const { dispatch, nav } = this.props;
return (