Integrating Drawer with Friends

Next, we will modify the root file so that it does the following:

  • Renders a DrawerLayoutAndroid component wrapped around Icon.ToolbarAndroid and Navigator.
  • Imports and sets the renderNavigationView of DrawerLayoutAndroid to the Drawer component we created.
  • Creates a callback to open DrawerLayoutAndroid.
  • Writes a callback named _navigateTo that navigates to a given index. Pass this to LoginPage as a prop.
  • Imports and renders the App, LoginPage, PostView, and WebViewComponent components using the renderScene callback in Navigator:
 // Friends/ import React, { Component } from 'react'; import { AppRegistry, DrawerLayoutAndroid, Navigator, StyleSheet, View } from 'react-native'; ...

Get React Native By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.