Created
May 17, 2017 15:31
-
-
Save chapeljuice/bef4b0a4dedef2994c81f3634b81aa43 to your computer and use it in GitHub Desktop.
React Navigation not working. Getting error: "undefined is not an object (evaluating 'this.props.navigation.navigate')".
This file contains 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 { Image, ListView, ScrollView, Text, TouchableOpacity, View } from 'react-native' | |
import styles from './Styles/CardStyle' | |
import { connect } from 'react-redux' | |
import Icon from 'react-native-vector-icons/FontAwesome' | |
import ButtonCTA from '../Components/ButtonCTA' | |
import CheckInStatus from '../Components/CheckInStatus' | |
class Card extends React.Component { | |
render() { | |
const { navigate } = this.props.navigation; | |
return ( | |
<View> | |
<ButtonCTA text='View Details' onPress={() => navigate('DetailsScreen')} /> | |
</View> | |
) | |
} | |
} | |
const mapStateToProps = (state) => { | |
return { | |
dataSource: state.dataSource | |
} | |
} | |
export default connect(mapStateToProps)(Card) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment