Skip to content

Commit d133aec

Browse files
author
Sankhadeep
committed
Merge branch 'NazarYablonskiy-master'
2 parents 268e3bf + ec88b0d commit d133aec

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Components/Widgets/Tabs.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ import computeProps from '../../Utils/computeProps';
77
import ScrollableTabView from './../vendor/react-native-scrollable-tab-view';
88

99
export default class TabNB extends NativeBaseComponent {
10-
1110
propTypes: {
1211
style : React.PropTypes.object
1312
}
1413

14+
constructor(props) {
15+
super(props);
16+
17+
this.goToPage = this.goToPage.bind(this);
18+
}
19+
20+
goToPage(page) {
21+
this._scrollableTabView.goToPage(page);
22+
}
23+
1524
getInitialStyle() {
1625
return {
1726
tab: {
@@ -33,7 +42,7 @@ export default class TabNB extends NativeBaseComponent {
3342
render() {
3443
var children = Array.isArray(this.props.children) ? this.props.children : [this.props.children];
3544
return(
36-
<ScrollableTabView {...this.prepareRootProps()} >
45+
<ScrollableTabView ref={(c) => {this._scrollableTabView = c}} {...this.prepareRootProps()} >
3746
{children.filter(child => child)}
3847
</ScrollableTabView>
3948
);

0 commit comments

Comments
 (0)