Created
December 7, 2016 22:49
-
-
Save dabit3/c8d286a02a77875a222e586300a84fb6 to your computer and use it in GitHub Desktop.
Navigation Card Stack implementation with Redux - Home
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
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