File tree 1 file changed +11
-2
lines changed 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,20 @@ import computeProps from '../../Utils/computeProps';
7
7
import ScrollableTabView from './../vendor/react-native-scrollable-tab-view' ;
8
8
9
9
export default class TabNB extends NativeBaseComponent {
10
-
11
10
propTypes : {
12
11
style : React . PropTypes . object
13
12
}
14
13
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
+
15
24
getInitialStyle ( ) {
16
25
return {
17
26
tab : {
@@ -33,7 +42,7 @@ export default class TabNB extends NativeBaseComponent {
33
42
render ( ) {
34
43
var children = Array . isArray ( this . props . children ) ? this . props . children : [ this . props . children ] ;
35
44
return (
36
- < ScrollableTabView { ...this . prepareRootProps ( ) } >
45
+ < ScrollableTabView ref = { ( c ) => { this . _scrollableTabView = c } } { ...this . prepareRootProps ( ) } >
37
46
{ children . filter ( child => child ) }
38
47
</ ScrollableTabView >
39
48
) ;
You can’t perform that action at this time.
0 commit comments