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
This commit is contained in:
parent
54d8f221c2
commit
0fdbfb029e
|
@ -78,7 +78,7 @@ render() {
|
|||
<Navigator
|
||||
initialRoute={{ title: 'My Initial Scene', index: 0 }}
|
||||
renderScene={(route, navigator) => {
|
||||
<MyScene title={route.title} />
|
||||
return <MyScene title={route.title} />
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
@ -112,6 +112,7 @@ export default class SimpleNavigationApp extends Component {
|
|||
<Navigator
|
||||
initialRoute={{ title: 'My Initial Scene', index: 0 }}
|
||||
renderScene={(route, navigator) =>
|
||||
return (
|
||||
<MyScene
|
||||
title={route.title}
|
||||
|
||||
|
@ -131,6 +132,7 @@ export default class SimpleNavigationApp extends Component {
|
|||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue