fix(tabs-ios): crash when setting tabStripItems through items property (#7548)

This commit is contained in:
Alexander Djenkov
2019-07-22 09:59:45 +03:00
committed by GitHub
parent 46c17ca3a4
commit 4511c76f49

View File

@ -590,6 +590,11 @@ export class Tabs extends TabsBase {
this._ios.dataSource = this._dataSource;
this._ios.delegate = this._delegate;
if (!this.tabBarItems) {
const tabStripItems = this.tabStrip ? this.tabStrip.items : null;
this.setTabStripItems(tabStripItems);
}
}
public onUnloaded() {
@ -836,6 +841,10 @@ export class Tabs extends TabsBase {
}
public setTabStripItems(items: Array<TabStripItem>) {
if (!this.tabStrip || !items) {
return;
}
const tabBarItems = [];
items.forEach((item: TabStripItem, i) => {