Reader small image

You're reading from  React Native By Example

Product typeBook
Published inApr 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786464750
Edition1st Edition
Languages
Right arrow
Author (1)
Richard Kho
Richard Kho
author image
Richard Kho

Richard Kho is a software engineer living in San Francisco. He taught himself how to code in 2014 and has lived a past life as a photographer and cinematographer. He currently works for Capital One and has taught software engineers at Hack Reactor in the past. Richard is also a technical advisor to Code Chrysalis, an advanced software engineering immersive in Tokyo.
Read more about Richard Kho

Right arrow

Signing out with TabBarIOS


Our final step involves adding a sign out page for the user. Using the TabBarIOS component and the react-native-vector-icons, we will create a tabbed view that allows the user to sign out.

Let's make some modifications for this to happen. We need to first modify App.js so that it does the following functions:

  • Imports the TabBarIOS and react-native-vector-icons dependencies
  • Returns a TabBarIOS component in its _renderView method if the activity indicator is not spinning
  • Add a selectedTab string in the App component's state to track which tab is currently chosen, defaulting to the FeedList component
  • Has separate functions to render the FeedList and LoginPage components without navigation
  • Passes the LoginPage a callback that executes the _checkLoginStatus method
  • Modifies its container style to no longer justify nor align any items to the center

Then, modify the LoginPage component so that its onLogoutFinished callback will execute _checkLoginStatus. Import new dependencies...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
React Native By Example
Published in: Apr 2017Publisher: PacktISBN-13: 9781786464750

Author (1)

author image
Richard Kho

Richard Kho is a software engineer living in San Francisco. He taught himself how to code in 2014 and has lived a past life as a photographer and cinematographer. He currently works for Capital One and has taught software engineers at Hack Reactor in the past. Richard is also a technical advisor to Code Chrysalis, an advanced software engineering immersive in Tokyo.
Read more about Richard Kho