Skip to content

Commit b32029f

Browse files
himanshusonifacebook-github-bot
authored andcommitted
remove createReactClass from RNTester/js/SwipeableFlatListExample.js (#21613)
Summary: Related to #21581 . Removed createReactClass from the RNTester/js/SwipeableFlatListExample.js Test Plan ----- - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android - [x] Run RNTester app, go to SwipeableFlatList component, everything works. Release Notes -------- [GENERAL] [ENHANCEMENT] [RNTester/js/SwipeableFlatListExample.js] - remove createReactClass dependency Pull Request resolved: #21613 Differential Revision: D10275399 Pulled By: RSNara fbshipit-source-id: 63030ca7da979a3d25bb94d52d4fd59994504aa3
1 parent 80fd4bb commit b32029f

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

RNTester/js/SwipeableFlatListExample.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
'use strict';
1111

1212
const React = require('react');
13-
const createReactClass = require('create-react-class');
1413
const ReactNative = require('react-native');
1514
const {
1615
Image,
@@ -24,6 +23,8 @@ const {
2423

2524
const RNTesterPage = require('./RNTesterPage');
2625

26+
import type {RNTesterProps} from 'RNTesterTypes';
27+
2728
const data = [
2829
{
2930
key: 'like',
@@ -42,14 +43,11 @@ const data = [
4243
},
4344
];
4445

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.';
5149

52-
render: function() {
50+
render() {
5351
return (
5452
<RNTesterPage
5553
title={this.props.navigator ? null : '<SwipeableListView>'}
@@ -64,9 +62,9 @@ const SwipeableFlatListExample = createReactClass({
6462
/>
6563
</RNTesterPage>
6664
);
67-
},
65+
}
6866

69-
_renderItem: function({item}): ?React.Element<any> {
67+
_renderItem({item}): ?React.Element<any> {
7068
return (
7169
<View style={styles.row}>
7270
<Image style={styles.rowIcon} source={item.icon} />
@@ -75,9 +73,9 @@ const SwipeableFlatListExample = createReactClass({
7573
</View>
7674
</View>
7775
);
78-
},
76+
}
7977

80-
_renderQuickActions: function({item}: Object): ?React.Element<any> {
78+
_renderQuickActions({item}: Object): ?React.Element<any> {
8179
return (
8280
<View style={styles.actionsContainer}>
8381
<TouchableHighlight
@@ -102,8 +100,8 @@ const SwipeableFlatListExample = createReactClass({
102100
</TouchableHighlight>
103101
</View>
104102
);
105-
},
106-
});
103+
}
104+
}
107105

108106
var styles = StyleSheet.create({
109107
row: {

0 commit comments

Comments
 (0)