Skip to content

Commit 89bb57d

Browse files
committed
Props for spring tension and friction
Added default props for tension and friction. Use those values in goToPage method instead of hard coded defaults.
1 parent f109d7e commit 89bb57d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var ScrollableTabView = React.createClass({
1717
getDefaultProps() {
1818
return {
1919
edgeHitWidth: 30,
20+
springTension: 50,
21+
springFriction: 10
2022
}
2123
},
2224

@@ -80,7 +82,7 @@ var ScrollableTabView = React.createClass({
8082
currentPage: pageNumber
8183
});
8284

83-
Animated.spring(this.state.scrollValue, {toValue: pageNumber, friction: 10, tension: 50}).start();
85+
Animated.spring(this.state.scrollValue, {toValue: pageNumber, friction: this.props.springFriction, tension: this.props.springTension}).start();
8486
},
8587

8688
renderTabBar(props) {

0 commit comments

Comments
 (0)