Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 501edde

Browse files
committed
refactor: drop usage of createClass from React object use create-react-class module instead
1 parent 9af8221 commit 501edde

20 files changed

+39
-34
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"react-native": "^0.43.0"
4646
},
4747
"dependencies": {
48+
"create-react-class": "^15.5.1",
4849
"cubic-bezier": "^0.1.2",
4950
"invariant": "^2.2.1",
5051
"keymirror": "^0.1.1",

src/components/ActivityIndicator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
22
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicator.js
33
*/
4-
import React from 'react';
54
import PropTypes from 'prop-types';
5+
import createReactClass from 'create-react-class';
66
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
77
import ColorPropType from '../propTypes/ColorPropType';
88
import View from './View';
99

10-
const ActivityIndicator = React.createClass({
10+
const ActivityIndicator = createReactClass({
1111
propTypes: {
1212
...View.propTypes,
1313
/**

src/components/ActivityIndicatorIOS.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicatorIOS.ios.js
33
*/
4-
import React from 'react';
54
import PropTypes from 'prop-types';
5+
import createReactClass from 'create-react-class';
66
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
77
import View from './View';
88

9-
const ActivityIndicatorIOS = React.createClass({
9+
const ActivityIndicatorIOS = createReactClass({
1010
propTypes: {
1111
...View.propTypes,
1212
/**

src/components/DrawerLayoutAndroid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/**
22
*https://github.com/facebook/react-native/blob/master/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js
33
*/
4-
import React from 'react';
54
import PropTypes from 'prop-types';
5+
import createReactClass from 'create-react-class';
66
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
77
import UIManager from '../NativeModules/UIManager';
88
import ColorPropType from '../propTypes/ColorPropType';
99
import View from './View';
1010

1111
const DrawerConsts = UIManager.AndroidDrawerLayout.Constants;
1212

13-
const DrawerLayoutAndroid = React.createClass({
13+
const DrawerLayoutAndroid = createReactClass({
1414

1515
propTypes: {
1616
...View.propTypes,

src/components/Image.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
22
* https://github.com/facebook/react-native/blob/master/Libraries/Image/Image.ios.js
33
*/
4-
import React from 'react';
54
import PropTypes from 'prop-types';
5+
import createReactClass from 'create-react-class';
66
import styleSheetPropType from '../propTypes/StyleSheetPropType';
77
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
88
import EdgeInsetsPropType from '../propTypes/EdgeInsetsPropType';
99
import ImageStylePropTypes from '../propTypes/ImageStylePropTypes';
1010
import ImageResizeMode from '../propTypes/ImageResizeMode';
1111

12-
const Image = React.createClass({
12+
const Image = createReactClass({
1313
propTypes: {
1414
style: styleSheetPropType(ImageStylePropTypes),
1515
/**

src/components/ListView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import createReactClass from 'create-react-class';
34
import TimerMixin from 'react-timer-mixin';
45
import ScrollResponder from '../mixins/ScrollResponder';
56
import ListViewDataSource from '../api/ListViewDataSource';
67
import ScrollView from './ScrollView';
78

89
const SCROLLVIEW_REF = 'listviewscroll';
910

10-
const ListView = React.createClass({
11+
const ListView = createReactClass({
1112
propTypes: {
1213
...ScrollView.propTypes,
1314

src/components/Navigator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
21
import PropTypes from 'prop-types';
2+
import createReactClass from 'create-react-class';
33
import createMockComponent from './createMockComponent';
44
import View from './View';
55

@@ -24,7 +24,7 @@ const NavigatorSceneConfigs = {
2424
VerticalDownSwipeJump: NavigatorSceneConfigType
2525
};
2626

27-
const Navigator = React.createClass({
27+
const Navigator = createReactClass({
2828
propTypes: {
2929
/**
3030
* Optional function that allows configuration about scene animations and

src/components/Picker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
21
import PropTypes from 'prop-types';
2+
import createReactClass from 'create-react-class';
33
import createMockComponent from './createMockComponent';
44

5-
const Picker = React.createClass({
5+
const Picker = createReactClass({
66
propTypes: {
77
children: PropTypes.node
88
},

src/components/ScrollView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import createReactClass from 'create-react-class';
34
import EdgeInsetsPropType from '../propTypes/EdgeInsetsPropType';
45
import PointPropType from '../propTypes/PointPropType';
56
import ScrollResponder from '../mixins/ScrollResponder';
@@ -11,7 +12,7 @@ import View from './View';
1112
const SCROLLVIEW = 'ScrollView';
1213
const INNERVIEW = 'InnerScrollView';
1314

14-
const ScrollView = React.createClass({
15+
const ScrollView = createReactClass({
1516
propTypes: {
1617
...View.propTypes,
1718
/**

src/components/StatusBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* https://github.com/facebook/react-native/blob/master/Libraries/Components/StatusBar/StatusBar.js
33
*/
4-
import React from 'react';
54
import PropTypes from 'prop-types';
5+
import createReactClass from 'create-react-class';
66
import ColorPropType from '../propTypes/ColorPropType';
77

88
let _backgroundColor = '';
@@ -11,7 +11,7 @@ let _hidden = false;
1111
let _networkActivityIndicatorVisible = false;
1212
let _translucent = false;
1313

14-
const StatusBar = React.createClass({
14+
const StatusBar = createReactClass({
1515
propTypes: {
1616
animated: PropTypes.bool,
1717
barStyle: PropTypes.oneOf(['default', 'light-content']),

0 commit comments

Comments
 (0)