Last active
January 21, 2018 16:46
-
-
Save anosikeosifo/526288e386ee2a12ea8160fd56cc3672 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//imports the navigators we've defined for our app | |
import ApplicationNavigator from "../navigators"; | |
//used in connecting the app's navigation data to redux | |
import { addNavigationHelpers } from "react-navigation"; | |
//takes the navigation slice of state and maps it to a prop, so we can used it around the application. | |
const mapStateToProps = state => ({ | |
navigation: state.navigationData | |
}); | |
const mapDispatchToProps = dispatch => ({ dispatch }); | |
class ApplicationNavigatorContainer extends Component { | |
. | |
. | |
. | |
render() { | |
return ( | |
<ApplicationNavigator | |
navigation={addNavigationHelpers({ | |
dispatch: this.props.dispatch, | |
state: this.props.navigation | |
})} | |
/> | |
); | |
} | |
} | |
export default connect(mapStateToProps, mapDispatchToProps)( | |
ApplicationNavigatorContainer | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment