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

Integrating Drawer with Friends

Next, we will modify the root index.android.js 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/index.android.js import React, { Component } from 'react'; import { AppRegistry, DrawerLayoutAndroid, Navigator, StyleSheet, View } from 'react-native'; ...

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