Skip to content

Commit 16dc0cb

Browse files
committed
Remove TabController.TabBar optimize prop
1 parent baa93f6 commit 16dc0cb

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/components/tabController/TabBar.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,7 @@ class TabBar extends PureComponent {
102102
/**
103103
* Pass to center selected item
104104
*/
105-
centerSelected: PropTypes.bool,
106-
/**
107-
* (Experimental) Pass to optimize loading time by measuring tab bar items text
108-
* instead of waiting for onLayout
109-
*/
110-
optimize: PropTypes.bool
105+
centerSelected: PropTypes.bool
111106
};
112107

113108
static defaultProps = {
@@ -147,7 +142,7 @@ class TabBar extends PureComponent {
147142
this.registerTabItems();
148143
}
149144

150-
if (this.items && props.optimize) {
145+
if (this.items) {
151146
this.measureItems();
152147
}
153148
}
@@ -263,7 +258,6 @@ class TabBar extends PureComponent {
263258
}
264259
};
265260

266-
// TODO: replace with measureItems logic
267261
onItemLayout = ({width, x}, itemIndex) => {
268262
this._itemsWidths[itemIndex] = width;
269263
this._itemsOffsets[itemIndex] = x;
@@ -319,7 +313,6 @@ class TabBar extends PureComponent {
319313
renderTabBarItems() {
320314
const {itemStates} = this.context;
321315
const {
322-
optimize,
323316
labelColor,
324317
selectedLabelColor,
325318
labelStyle,
@@ -352,7 +345,7 @@ class TabBar extends PureComponent {
352345
{...this.context}
353346
index={index}
354347
state={itemStates[index]}
355-
onLayout={optimize ? undefined : this.onItemLayout}
348+
onLayout={this.onItemLayout}
356349
/>
357350
);
358351
});

0 commit comments

Comments
 (0)