From 8a8244a58366d535959b90e27223b1b47fa40a12 Mon Sep 17 00:00:00 2001 From: Kureev Alexey Date: Sat, 4 Apr 2015 11:13:27 -0700 Subject: [PATCH] navigator.getCurrentRoutes() Summary: According to our talk with @ericvicenti about `renderScene` arguments Closes https://github.com/facebook/react-native/pull/553 Github Author: Kureev Alexey Test Plan: Imported from GitHub, without a `Test Plan:` line. --- Libraries/CustomComponents/Navigator/Navigator.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index b6aa47d03..89f3b49c2 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -318,6 +318,7 @@ var Navigator = React.createClass({ popToRoute: this.popToRoute, popToTop: this.popToTop, parentNavigator: this.props.navigator, + getCurrentRoutes: this.getCurrentRoutes, // We want to bubble focused routes to the top navigation stack. If we // are a child navigator, this allows us to call props.navigator.on*Focus // of the topmost Navigator @@ -998,6 +999,10 @@ var Navigator = React.createClass({ } }, + getCurrentRoutes: function() { + return this.state.routeStack; + }, + _onItemRef: function(itemId, ref) { this._itemRefs[itemId] = ref; var itemIndex = this.state.idStack.indexOf(itemId);