O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a PostView

At the end of Chapter 5, Third Project - The Facebook Client, we created a FeedListRow component with a TouchableHighlight that fired the following function when pressed:

// Friends/app/components/FeedListRow/index.js 

... 
  _navigateToPostView () { 
    console.log('pushed'); 
  } 
... 

We will build a PostView component that our users will navigate to when the TouchableHighlight component is pressed in FeedListRow and replace the current login within this _navigfateToPostView function to handle that navigation.

This PostView component should, upon loading, look in AsyncStorage for this post's details and load them if it exists. If it does not, then it should make a request to the Facebook Graph API for the post's details and save ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required