Skip to content

Instantly share code, notes, and snippets.

@dabit3
Created December 7, 2016 22:49
Show Gist options
  • Save dabit3/c8d286a02a77875a222e586300a84fb6 to your computer and use it in GitHub Desktop.
Save dabit3/c8d286a02a77875a222e586300a84fb6 to your computer and use it in GitHub Desktop.
Navigation Card Stack implementation with Redux - Home
import React from 'react'
import { View, Text } from 'react-native'
import { connect } from 'react-redux'
import { push } from './navActions'
const styles = {
container: {
justifyContent: 'center',
alignItems: 'center',
flex: 1
},
}
const Home = ({ push }) => {
return (
<View style={styles.container}>
<Text>Hello from Home</Text>
<Text onPress={() => push({ key: 'About' })}>Go To About</Text>
</View>
)
}
function mapStateToProps () { return {} }
function mapDispatchToProps (dispatch) {
return {
push: (route) => dispatch(push(route))
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(Home)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment