Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[createReactClass] remove createReactClass from RNTester/js/SwipeableFlatListExample.js #21613

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions RNTester/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