Skip to content

Commit a7eafdd

Browse files
authored
Update CustomTabBar.js
fix: Dynamic max tabs number
1 parent 8c2d144 commit a7eafdd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CustomTabBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default class CustomTabBar extends Component {
6767
});
6868

6969
const scaleValue = (defaultScale) => {
70-
let number = 4
70+
let number = this.props.tabs.length;
7171
let arr = new Array(number * 2)
7272
return arr.fill(0).reduce(function(pre, cur, idx){
7373
idx == 0 ? pre.inputRange.push(cur) : pre.inputRange.push(pre.inputRange[idx-1] + 0.5);
@@ -141,4 +141,4 @@ const styles = StyleSheet.create({
141141
borderRightWidth: 0,
142142
borderColor: '#f4f4f4',
143143
},
144-
});
144+
});

0 commit comments

Comments
 (0)