Getting Started with React Navigation, the Navigation Solution for React Native
Spencer Carli
60649

Thanks for the tutorial, everything is working for me except for passing my data objects from the first component to the new component.

When I try to pass the data like you did into my new component:

render(){
const { title, description, pubdate, link } = this.props.navigation.state.params;

It says the properties are undefined.

Yet when I console.log(this.props.navigation.state.params) I can see all of these properties listed (title, description, pubdate, link) .

How can I access this data to use in my return like so?

return (
 <View style={styles.container}>
 <Text>{title}</Text>
 <Text>{pubdate}</Text>
 <Text>{description}</Text> 
 </View>
);

Show your support

Clapping shows how much you appreciated David Gauch’s story.