From aa1fe0837253d731098366ad8ca4bd13dc5a2af2 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Sun, 23 Oct 2016 21:09:04 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/using-navigators.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/releases/next/docs/using-navigators.html b/releases/next/docs/using-navigators.html index 8ca909374df..13a999709e7 100644 --- a/releases/next/docs/using-navigators.html +++ b/releases/next/docs/using-navigators.html @@ -43,7 +43,7 @@ AppRegistry. }); navigator.pop();

A more complete example that demonstrates the pushing and popping of routes. Edit your index*.js file to look something like this:

import React, { Component } from 'react'; -import { AppRegistry, Navigator, Text, View } from 'react-native'; +import { AppRegistry, Navigator } from 'react-native'; import MyScene from './MyScene'; @@ -82,11 +82,6 @@ AppRegistry. import { View, Text, TouchableHighlight } from 'react-native'; export default class MyScene extends Component { - static propTypes = { - title: PropTypes.string.isRequired, - onForward: PropTypes.func.isRequired, - onBack: PropTypes.func.isRequired, - } render() { return ( <View> @@ -100,7 +95,13 @@ export default class MyScene extends /View> ) } -}

In this example, the MyScene component is passed the title of the current route via the title prop. It displays two tappable components that call the onForward and onBack functions passed through its props, which in turn will call navigator.push() and navigator.pop() as needed.

Check out the Navigator API reference for more Navigator code samples, or read through the Navigation guide for other examples of what you can do with navigators.

High Five! #

If you've gotten here by reading linearly through the tutorial, then you are a pretty impressive human being. Congratulations. Next, you might want to check out all the cool stuff the community does with React Native.

You can edit the content above on GitHub and send us a pull request!