Skip to content

Commit

Permalink
bugfix: NavigatoriOS doesn't update any scenes when 0th scene is repl…
Browse files Browse the repository at this point in the history
…aced

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 #5155

Reviewed By: svcscm

Differential Revision: D2807397

Pulled By: nicklockwood

fb-gh-sync-id: 519a4ab35c86b0b608808b36593f5f8c2ecd1561
  • Loading branch information
ognen authored and facebook-github-bot-9 committed Jan 6, 2016
1 parent 7b63b22 commit 61025a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Components/Navigation/NavigatorIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 61025a9

Please sign in to comment.