From b32029f346ed88269c587824e661fb55850389e1 Mon Sep 17 00:00:00 2001 From: Himanshu Soni Date: Tue, 9 Oct 2018 17:11:24 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/21613 Differential Revision: D10275399 Pulled By: RSNara fbshipit-source-id: 63030ca7da979a3d25bb94d52d4fd59994504aa3 --- RNTester/js/SwipeableFlatListExample.js | 26 ++++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/RNTester/js/SwipeableFlatListExample.js b/RNTester/js/SwipeableFlatListExample.js index 3a1fbd8bc..7f27b4dc2 100644 --- a/RNTester/js/SwipeableFlatListExample.js +++ b/RNTester/js/SwipeableFlatListExample.js @@ -10,7 +10,6 @@ 'use strict'; const React = require('react'); -const createReactClass = require('create-react-class'); const ReactNative = require('react-native'); const { Image, @@ -24,6 +23,8 @@ const { const RNTesterPage = require('./RNTesterPage'); +import type {RNTesterProps} from 'RNTesterTypes'; + const data = [ { key: 'like', @@ -42,14 +43,11 @@ const data = [ }, ]; -const SwipeableFlatListExample = createReactClass({ - displayName: 'SwipeableFlatListExample', - statics: { - title: '', - description: 'Performant, scrollable, swipeable list of data.', - }, +class SwipeableFlatListExample extends React.Component { + static title = ''; + static description = 'Performant, scrollable, swipeable list of data.'; - render: function() { + render() { return ( '} @@ -64,9 +62,9 @@ const SwipeableFlatListExample = createReactClass({ /> ); - }, + } - _renderItem: function({item}): ?React.Element { + _renderItem({item}): ?React.Element { return ( @@ -75,9 +73,9 @@ const SwipeableFlatListExample = createReactClass({ ); - }, + } - _renderQuickActions: function({item}: Object): ?React.Element { + _renderQuickActions({item}: Object): ?React.Element { return ( ); - }, -}); + } +} var styles = StyleSheet.create({ row: {