check if this._navBar has immediatelyRefresh method

Summary:
`Navigator` throws an error if using a custom `NavigationBar` component that does not have a `immediatelyRefresh` method present.
Closes https://github.com/facebook/react-native/pull/9438

Differential Revision: D3838928

Pulled By: mkonicek

fbshipit-source-id: 74d62ef09e179f457a4b14f8537dfaf0d4697322
This commit is contained in:
Andrew Grewell 2016-09-08 17:24:12 -07:00 коммит произвёл Facebook Github Bot
Родитель 6b42d5c952
Коммит 7b18b2c409
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -495,7 +495,10 @@ var Navigator = React.createClass({
transitionQueue: [],
}, () => {
this._handleSpringUpdate();
this._navBar && this._navBar.immediatelyRefresh();
var navBar = this._navBar;
if (navBar && navBar.immediatelyRefresh) {
navBar.immediatelyRefresh();
}
this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]);
});
},