From 0fdbfb029ea279e5ab119086ccfa013f727e2ace Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Wed, 3 Aug 2016 11:24:41 -0700 Subject: [PATCH] Return statement missing for renderScene Summary: Explain the **motivation** for making this change. What existing problem does the pull request solve? Example code for "Using Navigators" under "THE BASICS" does not work. renderScene needs to return the components, not just instantiate them. **Test plan (required)** I copy-paste and ran the code but did not get anything rendered. I added a return statement before the component which made it work. Arrow functions need a return statement when supplying a { block of code }. Closes https://github.com/facebook/react-native/pull/9161 Differential Revision: D3663200 Pulled By: hramos fbshipit-source-id: a8732dd1098de7c8ea915f459adb3403a8168f19 --- docs/UsingNavigators.md | 42 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/docs/UsingNavigators.md b/docs/UsingNavigators.md index dd7eef7921b..17dc5e1e855 100644 --- a/docs/UsingNavigators.md +++ b/docs/UsingNavigators.md @@ -78,7 +78,7 @@ render() { { - + return }} /> ); @@ -112,25 +112,27 @@ export default class SimpleNavigationApp extends Component { - { - const nextIndex = route.index + 1; - navigator.push({ - title: 'Scene ' + nextIndex, - index: nextIndex, - }); - }} - - // Function to call to go back to the previous scene - onBack={() => { - if (route.index > 0) { - navigator.pop(); - } - }} - /> + return ( + { + const nextIndex = route.index + 1; + navigator.push({ + title: 'Scene ' + nextIndex, + index: nextIndex, + }); + }} + + // Function to call to go back to the previous scene + onBack={() => { + if (route.index > 0) { + navigator.pop(); + } + }} + /> + ) } /> )