Skip to content

Commit

Permalink
Implement renderScene API for NavigatorIOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
drtangible committed Jul 4, 2016
1 parent 3fd247a commit 99964ae
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions Libraries/Components/Navigation/NavigatorIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ var NavigatorIOS = React.createClass({
/**
* The React Class to render for this route
*/
component: PropTypes.func.isRequired,
component: PropTypes.func,

/**
* The title displayed in the navigation bar and the back button for this
Expand Down Expand Up @@ -805,29 +805,24 @@ var NavigatorIOS = React.createClass({
},

_routeToStackItem: function(routeArg: Route, i: number) {
var {component, wrapperStyle, passProps, ...route} = routeArg;
var {wrapperStyle, ...route} = routeArg;
var {itemWrapperStyle, ...props} = this.props;
var shouldUpdateChild =
this.state.updatingAllIndicesAtOrBeyond != null &&
this.state.updatingAllIndicesAtOrBeyond >= i;
var Component = component;

return (
<StaticContainer key={'nav' + i} shouldUpdate={shouldUpdateChild}>
<RCTNavigatorItem
{...props}
{...route}
style={[
styles.stackItem,
itemWrapperStyle,
wrapperStyle
]}>
<Component
navigator={this.navigator}
route={route}
{...passProps}
/>
</RCTNavigatorItem>
</StaticContainer>
<RCTNavigatorItem
key={'key'+i}
{...props}
{...route}
style={[
styles.stackItem,
itemWrapperStyle,
wrapperStyle
]}>
{this.props.renderScene(
route,
this,
)}
</RCTNavigatorItem>
);
},

Expand Down

0 comments on commit 99964ae

Please sign in to comment.