Skip to content

Instantly share code, notes, and snippets.

@dk0r
Last active September 13, 2017 16:52
Show Gist options
  • Save dk0r/544e4a086ffaf01d52b378ad1d18131e to your computer and use it in GitHub Desktop.
Save dk0r/544e4a086ffaf01d52b378ad1d18131e to your computer and use it in GitHub Desktop.
undefined is not an object (evaluating 'this.props.event.location')
import Child from './Child'
let newEvent = {
location: { latitude: 42.816006, longitude: -73.911287},
color: 'wheat'
}
export default class Parent extends React.Component {
render() {
//console.log('I am the Parent!!!')
//console.log(newEvent)
return (
//<Child event={newEvent}/>
<Child testProp="IMAString"/>
)
}
}
export default class Child extends React.Component {
render() {
console.log('I am the Child!!!')
console.log(this.props)
return (
// <MapView
// initialRegion={{
// latitude: this.props.event.location.latitude,
// longitude: this.props.event.location.longitude,
// }}
// />
<View>
<Text>..Just Some Text...</Text>
</View>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment