@@ -23,16 +23,22 @@ const messages = [
23
23
'Here is where you can view demos of all Uilib components'
24
24
] ;
25
25
26
- class FeatureHighlightScreen extends Component {
27
- constructor ( props ) {
26
+ interface State {
27
+ currentTargetIndex : number ;
28
+ showFTE : boolean ;
29
+ }
30
+
31
+ class FeatureHighlightScreen extends Component < { } , State > {
32
+ viewRef : any ;
33
+ targets : { [ key : string ] : any } = { } ;
34
+
35
+ constructor ( props : any ) {
28
36
super ( props ) ;
29
37
30
38
this . state = {
31
39
showFTE : false ,
32
40
currentTargetIndex : 0
33
41
} ;
34
-
35
- this . targets = { } ;
36
42
}
37
43
38
44
componentDidMount ( ) {
@@ -46,7 +52,7 @@ class FeatureHighlightScreen extends Component {
46
52
this . setState ( { showFTE : false } , ( ) => {
47
53
if ( this . viewRef ) {
48
54
const reactTag = findNodeHandle ( this . viewRef ) ;
49
- AccessibilityInfo . setAccessibilityFocus ( reactTag ) ;
55
+ reactTag && AccessibilityInfo . setAccessibilityFocus ( reactTag ) ;
50
56
}
51
57
} ) ;
52
58
} ;
@@ -55,7 +61,7 @@ class FeatureHighlightScreen extends Component {
55
61
this . setState ( { showFTE : true } ) ;
56
62
} ;
57
63
58
- addTarget ( ref , id ) {
64
+ addTarget ( ref : any , id : string ) {
59
65
if ( ref && ! this . targets [ id ] ) {
60
66
this . targets [ id ] = ref ;
61
67
}
@@ -68,7 +74,7 @@ class FeatureHighlightScreen extends Component {
68
74
this . moveToPage ( newTargetIndex ) ;
69
75
} ;
70
76
71
- moveToPage ( index ) {
77
+ moveToPage ( index : number ) {
72
78
if ( index < _ . size ( this . targets ) ) {
73
79
this . setState ( { currentTargetIndex : index } ) ;
74
80
} else {
@@ -87,7 +93,7 @@ class FeatureHighlightScreen extends Component {
87
93
} ;
88
94
}
89
95
90
- onPagePress = index => {
96
+ onPagePress = ( index : number ) => {
91
97
this . moveToPage ( index ) ;
92
98
} ;
93
99
0 commit comments