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

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 ...

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