Skip to content

Commit f5c52d2

Browse files
committed
fix: default checkedIndex is null shown underline
1 parent 3da3b15 commit f5c52d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export default class ScrollableTabView extends React.Component {
438438
const pluginName = packagejson.name;
439439
const msg = `${pluginName}: ${message || ' --- '}`;
440440
console[level](msg);
441-
if (errorToThrow) throw new Error(msg);
441+
if (errorToThrow && level == CONSOLE_LEVEL.ERROR) throw new Error(msg);
442442
}
443443

444444
_errorProps(propName, level) {
@@ -480,12 +480,12 @@ export default class ScrollableTabView extends React.Component {
480480
horizontal={true}
481481
>
482482
{this.tabs.map((tab, index) => this._renderTab({ item: tab, index }))}
483-
{tabsEnableAnimated && this._renderAnimatedTabUnderline()}
483+
{tabsEnableAnimated && this.state.checkedIndex !== null && this._renderAnimatedTabUnderline()}
484484
</ScrollView>
485485
) : (
486486
<View style={_tabsStyle}>
487487
{this.tabs.map((tab, index) => this._renderTab({ item: tab, index }))}
488-
{tabsEnableAnimated && this._renderAnimatedTabUnderline()}
488+
{tabsEnableAnimated && this.state.checkedIndex !== null && this._renderAnimatedTabUnderline()}
489489
</View>
490490
))
491491
);

0 commit comments

Comments
 (0)