Skip to content

Commit

Permalink
remove createReactClass from RNTester/js/SwipeableFlatListExample.js …
Browse files Browse the repository at this point in the history
…(#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: facebook/react-native#21613

Differential Revision: D10275399

Pulled By: RSNara

fbshipit-source-id: 63030ca7da979a3d25bb94d52d4fd59994504aa3
  • Loading branch information
himanshusoni authored and facebook-github-bot committed Oct 10, 2018
1 parent fc8df89 commit 6540903
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions js/SwipeableFlatListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
'use strict';

const React = require('react');
const createReactClass = require('create-react-class');
const ReactNative = require('react-native');
const {
Image,
Expand All @@ -24,6 +23,8 @@ const {

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

import type {RNTesterProps} from 'RNTesterTypes';

const data = [
{
key: 'like',
Expand All @@ -42,14 +43,11 @@ const data = [
},
];

const SwipeableFlatListExample = createReactClass({
displayName: 'SwipeableFlatListExample',
statics: {
title: '<SwipeableFlatList>',
description: 'Performant, scrollable, swipeable list of data.',
},
class SwipeableFlatListExample extends React.Component<RNTesterProps> {
static title = '<SwipeableFlatList>';
static description = 'Performant, scrollable, swipeable list of data.';

render: function() {
render() {
return (
<RNTesterPage
title={this.props.navigator ? null : '<SwipeableListView>'}
Expand All @@ -64,9 +62,9 @@ const SwipeableFlatListExample = createReactClass({
/>
</RNTesterPage>
);
},
}

_renderItem: function({item}): ?React.Element<any> {
_renderItem({item}): ?React.Element<any> {
return (
<View style={styles.row}>
<Image style={styles.rowIcon} source={item.icon} />
Expand All @@ -75,9 +73,9 @@ const SwipeableFlatListExample = createReactClass({
</View>
</View>
);
},
}

_renderQuickActions: function({item}: Object): ?React.Element<any> {
_renderQuickActions({item}: Object): ?React.Element<any> {
return (
<View style={styles.actionsContainer}>
<TouchableHighlight
Expand All @@ -102,8 +100,8 @@ const SwipeableFlatListExample = createReactClass({
</TouchableHighlight>
</View>
);
},
});
}
}

var styles = StyleSheet.create({
row: {
Expand Down

0 comments on commit 6540903

Please sign in to comment.