Skip to content

Instantly share code, notes, and snippets.

@carlossaraiva
Last active March 27, 2018 18:10
Show Gist options
  • Save carlossaraiva/387744392fff667cb4072423ebe563b4 to your computer and use it in GitHub Desktop.
Save carlossaraiva/387744392fff667cb4072423ebe563b4 to your computer and use it in GitHub Desktop.
native-base
import React, { Component } from 'react'
import { Root } from "native-base"
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { addNavigationHelpers } from 'react-navigation'
import RootNavigator from '@navigators/root-navigator'
class App extends Component {
static navigationOptions = {
header: null,
tabBarVisible: true
}
render() {
const { dispatch, navigation, addListener } = this.props
return (
<Root>
<RootNavigator
navigation={addNavigationHelpers({
dispatch,
state: navigation,
addListener
})}
/>
</Root>
)
}
}
App.propTypes = {
dispatch: PropTypes.func,
navigation: PropTypes.object,
addListener: PropTypes.func
}
const mapStateToProps = ({ navigation }) => ({
navigation
})
export default connect(mapStateToProps)(App)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment