Skip to content

Instantly share code, notes, and snippets.

@rocksinghajay
Created April 30, 2019 18:16
Show Gist options
  • Select an option

  • Save rocksinghajay/c6989c40d8271f4f16a47616a584ed07 to your computer and use it in GitHub Desktop.

Select an option

Save rocksinghajay/c6989c40d8271f4f16a47616a584ed07 to your computer and use it in GitHub Desktop.
import React from 'react'
import { View, Text, Button } from 'react-native'
import { connect } from 'react-redux'
import { dummyAction } from '../actions/dummyAction'
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button
title="Go to Details"
onPress={() => {
this.props.dispatch(dummyAction('John Doe'))
this.props.navigation.navigate('Details')
}}
/>
</View>
);
}
}
export default connect(({dispatch}) => ({dispatch}))(HomeScreen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment