File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
src/components/tabController Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -102,12 +102,7 @@ class TabBar extends PureComponent {
102
102
/**
103
103
* Pass to center selected item
104
104
*/
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
111
106
} ;
112
107
113
108
static defaultProps = {
@@ -147,7 +142,7 @@ class TabBar extends PureComponent {
147
142
this . registerTabItems ( ) ;
148
143
}
149
144
150
- if ( this . items && props . optimize ) {
145
+ if ( this . items ) {
151
146
this . measureItems ( ) ;
152
147
}
153
148
}
@@ -263,7 +258,6 @@ class TabBar extends PureComponent {
263
258
}
264
259
} ;
265
260
266
- // TODO: replace with measureItems logic
267
261
onItemLayout = ( { width, x} , itemIndex ) => {
268
262
this . _itemsWidths [ itemIndex ] = width ;
269
263
this . _itemsOffsets [ itemIndex ] = x ;
@@ -319,7 +313,6 @@ class TabBar extends PureComponent {
319
313
renderTabBarItems ( ) {
320
314
const { itemStates} = this . context ;
321
315
const {
322
- optimize,
323
316
labelColor,
324
317
selectedLabelColor,
325
318
labelStyle,
@@ -352,7 +345,7 @@ class TabBar extends PureComponent {
352
345
{ ...this . context }
353
346
index = { index }
354
347
state = { itemStates [ index ] }
355
- onLayout = { optimize ? undefined : this . onItemLayout }
348
+ onLayout = { this . onItemLayout }
356
349
/>
357
350
) ;
358
351
} ) ;
You can’t perform that action at this time.
0 commit comments