April 2017
Intermediate to advanced
414 pages
8h 14m
English
The following code is an example for Navigator:
// index.android.jsimport React, { Component } from 'react'; import { AppRegistry, Navigator, } from 'react-native'; import TasksList from './app/components/TasksList'; import EditTask from './app/components/EditTask'; class Tasks extends Component { render () { const routes = [ { title: 'Tasks', index: 0 }, { title: 'Edit Task', index: 1 } ];
Again, establish routes for our app.
return ( <Navigator initialRoute={{ index: 0}} renderScene={ (routes, navigator) => this._renderScene(routes, navigator) }/> ); }
Import the Navigator component and render it for the user. It starts at index:0, which returns the TasksList component.
It returns TasksList if the index ...
Read now
Unlock full access