From 763d53ead626c26869ecfab757a7ab63d1114bb8 Mon Sep 17 00:00:00 2001 From: Jonathan Werner Date: Fri, 10 Jun 2016 13:12:36 +0200 Subject: [PATCH] removes render form from example app As discussed here https://github.com/jmurzy/react-router-native/commit/851e3c1f9b92f2557c091cbda41259a582992e59#commitcomment-17818287 Will keep render as Easter egg Closes #13 --- README.md | 11 +++++++---- examples/Aviato/index.ios.js | 12 ++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8eb7433..bdf375e 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,10 @@ Look at `app/routes.js` and play around with the app to get a feel for what's po ### Usage ```javascript -import { Router, Route, render } from 'react-router-native'; +// index.[ios|android].js -const APP_KEY = 'app' +import { AppRegistry } from 'react-native'; +import { Router, Route, TabsRoute } from 'react-router-native'; const App = (props) => (/*...*/); const About = (props) => (/*...*/); @@ -55,7 +56,7 @@ const User = (props) => (/*...*/); const UserHeader = (props) => (/*...*/); const NoMatch = (props) => (/*...*/); -render(( +const routes = ( /* Address Bar can be toggled on or off by setting the addressBar prop */ -), APP_KEY); +); + +AppRegistry.registerComponent('YourApp', () => () => routes); ``` ### Advanced Usage diff --git a/examples/Aviato/index.ios.js b/examples/Aviato/index.ios.js index e77a298..ef475cd 100644 --- a/examples/Aviato/index.ios.js +++ b/examples/Aviato/index.ios.js @@ -1,12 +1,4 @@ -import { render } from 'react-router-native'; +import { AppRegistry } from 'react-native'; import routes from './app/routes'; -render(routes, 'Aviato'); - -// -// - or - -// -// -// import { AppRegistry } from 'react-native'; -// -// AppRegistry.registerComponent('Aviato', () => () => routes); +AppRegistry.registerComponent('Aviato', () => () => routes);