bugfix: NavigatoriOS doesn't update any scenes when 0th scene is replaced
Summary: Calling navigator.replace(0, scene) has no effect. This is because 0 is false in Javascript so when this.state.updatingAllIndicesAtOrBeyond == 0 (meaning update all indices starting with 0) The whole expression evaluates to 0, i.e. false -> therefore no update happens. Explicitly checking for not-equal to null (!= will convert undefined to null automatically) fixes the issue. Closes https://github.com/facebook/react-native/pull/5155 Reviewed By: svcscm Differential Revision: D2807397 Pulled By: nicklockwood fb-gh-sync-id: 519a4ab35c86b0b608808b36593f5f8c2ecd1561
This commit is contained in:
parent
7b63b225a5
commit
61025a9b33
|
@ -639,7 +639,7 @@ var NavigatorIOS = React.createClass({
|
|||
var {component, wrapperStyle, passProps, ...route} = route;
|
||||
var {itemWrapperStyle, ...props} = this.props;
|
||||
var shouldUpdateChild =
|
||||
this.state.updatingAllIndicesAtOrBeyond &&
|
||||
this.state.updatingAllIndicesAtOrBeyond != null &&
|
||||
this.state.updatingAllIndicesAtOrBeyond >= i;
|
||||
var Component = component;
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue