10
10
'use strict' ;
11
11
12
12
const React = require ( 'react' ) ;
13
- const createReactClass = require ( 'create-react-class' ) ;
14
13
const ReactNative = require ( 'react-native' ) ;
15
14
const {
16
15
Image,
@@ -24,6 +23,8 @@ const {
24
23
25
24
const RNTesterPage = require ( './RNTesterPage' ) ;
26
25
26
+ import type { RNTesterProps } from 'RNTesterTypes' ;
27
+
27
28
const data = [
28
29
{
29
30
key : 'like' ,
@@ -42,14 +43,11 @@ const data = [
42
43
} ,
43
44
] ;
44
45
45
- const SwipeableFlatListExample = createReactClass ( {
46
- displayName : 'SwipeableFlatListExample' ,
47
- statics : {
48
- title : '<SwipeableFlatList>' ,
49
- description : 'Performant, scrollable, swipeable list of data.' ,
50
- } ,
46
+ class SwipeableFlatListExample extends React . Component < RNTesterProps > {
47
+ static title = '<SwipeableFlatList>' ;
48
+ static description = 'Performant, scrollable, swipeable list of data.' ;
51
49
52
- render : function ( ) {
50
+ render ( ) {
53
51
return (
54
52
< RNTesterPage
55
53
title = { this . props . navigator ? null : '<SwipeableListView>' }
@@ -64,9 +62,9 @@ const SwipeableFlatListExample = createReactClass({
64
62
/>
65
63
</ RNTesterPage >
66
64
) ;
67
- } ,
65
+ }
68
66
69
- _renderItem : function ( { item} ) : ?React . Element < any > {
67
+ _renderItem ( { item} ) : ?React . Element < any > {
70
68
return (
71
69
< View style = { styles . row } >
72
70
< Image style = { styles . rowIcon } source = { item . icon } />
@@ -75,9 +73,9 @@ const SwipeableFlatListExample = createReactClass({
75
73
</ View >
76
74
</ View >
77
75
) ;
78
- } ,
76
+ }
79
77
80
- _renderQuickActions: function ({ item } : Object): ?React.Element< any > {
78
+ _renderQuickActions ( { item} : Object ) : ?React . Element < any > {
81
79
return (
82
80
< View style = { styles . actionsContainer } >
83
81
< TouchableHighlight
@@ -102,8 +100,8 @@ const SwipeableFlatListExample = createReactClass({
102
100
</ TouchableHighlight >
103
101
</ View >
104
102
) ;
105
- } ,
106
- } ) ;
103
+ }
104
+ }
107
105
108
106
var styles = StyleSheet . create ( {
109
107
row : {
0 commit comments