Permalink
Browse files

Replace React.createClass with create-react-class

  • Loading branch information...
mojodna committed Jun 26, 2017
1 parent a2b0ee0 commit 658c7bb9a63632243d1deebe9a5624e002b99d69
Showing with 526 additions and 447 deletions.
  1. +2 −1 IntegrationTests/LayoutEventsTest.js
  2. +2 −1 IntegrationTests/ReactContentSizeUpdateTest.js
  3. +2 −1 IntegrationTests/SizeFlexibilityUpdateTest.js
  4. +2 −1 IntegrationTests/TimersTest.js
  5. +2 −1 Libraries/Components/ActivityIndicator/ActivityIndicator.js
  6. +2 −1 Libraries/Components/DatePicker/DatePickerIOS.ios.js
  7. +2 −1 Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js
  8. +2 −1 Libraries/Components/Keyboard/KeyboardAvoidingView.js
  9. +2 −1 Libraries/Components/LazyRenderer.js
  10. +2 −1 Libraries/Components/Navigation/NavigatorIOS.ios.js
  11. +2 −1 Libraries/Components/Picker/PickerIOS.ios.js
  12. +2 −1 Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js
  13. +2 −1 Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js
  14. +2 −1 Libraries/Components/RefreshControl/RefreshControl.js
  15. +2 −1 Libraries/Components/ScrollView/ScrollView.js
  16. +2 −1 Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js
  17. +2 −1 Libraries/Components/Slider/Slider.js
  18. +2 −1 Libraries/Components/Switch/Switch.js
  19. +2 −1 Libraries/Components/TextInput/TextInput.js
  20. +2 −1 Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js
  21. +2 −1 Libraries/Components/Touchable/TouchableBounce.js
  22. +2 −1 Libraries/Components/Touchable/TouchableHighlight.js
  23. +2 −1 Libraries/Components/Touchable/TouchableNativeFeedback.android.js
  24. +2 −1 Libraries/Components/Touchable/TouchableOpacity.js
  25. +2 −1 Libraries/Components/Touchable/TouchableWithoutFeedback.js
  26. +2 −1 Libraries/Components/View/View.js
  27. +2 −1 Libraries/Experimental/SwipeableRow/SwipeableRow.js
  28. +2 −1 Libraries/Image/Image.android.js
  29. +2 −1 Libraries/Image/Image.ios.js
  30. +2 −1 Libraries/Lists/ListView/ListView.js
  31. +350 −350 Libraries/Renderer/ReactNativeFiber-dev.js
  32. +2 −2 Libraries/Renderer/ReactNativeStack-dev.js
  33. +2 −1 Libraries/Text/Text.js
  34. +2 −1 Libraries/Text/TextUpdateTest.js
  35. +2 −1 RNTester/js/CameraRollView.js
  36. +5 −4 RNTester/js/ImageExample.js
  37. +2 −1 RNTester/js/ListViewExample.js
  38. +2 −1 RNTester/js/ListViewGridLayoutExample.js
  39. +2 −1 RNTester/js/PanResponderExample.js
  40. +2 −1 RNTester/js/ProgressBarAndroidExample.android.js
  41. +2 −1 RNTester/js/ProgressViewIOSExample.js
  42. +2 −1 RNTester/js/SwipeableListViewExample.js
  43. +2 −1 RNTester/js/TextExample.ios.js
  44. +2 −1 RNTester/js/TimerExample.js
  45. +3 −2 ReactAndroid/src/androidTest/js/ScrollViewTestModule.js
  46. +7 −6 ReactAndroid/src/androidTest/js/UIManagerTestModule.js
  47. +1 −1 docs/DirectManipulation.md
  48. +1 −1 docs/Timers.md
  49. +2 −1 website/core/AlgoliaDocSearch.js
  50. +2 −1 website/core/BlogPost.js
  51. +2 −1 website/core/BlogPostDate.js
  52. +2 −1 website/core/BlogPostExcerpt.js
  53. +2 −1 website/core/BlogPostFooter.js
  54. +2 −1 website/core/BlogPostHeader.js
  55. +2 −1 website/core/DocsSidebar.js
  56. +2 −1 website/core/EjectBanner.js
  57. +2 −1 website/core/ExcerptLink.js
  58. +2 −1 website/core/Footer.js
  59. +2 −1 website/core/H2.js
  60. +3 −1 website/core/Header.js
  61. +2 −1 website/core/HeaderLinks.js
  62. +2 −1 website/core/HeaderWithGithub.js
  63. +2 −1 website/core/Hero.js
  64. +2 −1 website/core/Marked.js
  65. +2 −1 website/core/Prism.js
  66. +2 −1 website/core/ShowcaseAppIcon.js
  67. +2 −1 website/core/Site.js
  68. +2 −1 website/core/SnackPlayer.js
  69. +2 −1 website/core/WebPlayer.js
  70. +2 −1 website/core/center.js
  71. +6 −5 website/layout/AutodocsLayout.js
  72. +2 −1 website/layout/BlogPageLayout.js
  73. +2 −1 website/layout/BlogPostLayout.js
  74. +2 −1 website/layout/DocsLayout.js
  75. +2 −1 website/layout/PageLayout.js
  76. +2 −1 website/layout/RedirectLayout.js
  77. +2 −1 website/server/convert.js
  78. +2 −1 website/src/react-native/404.js
  79. +3 −2 website/src/react-native/index.js
  80. +3 −2 website/src/react-native/showcase.js
  81. +2 −1 website/src/react-native/support.js
  82. +2 −1 website/src/react-native/versions.js
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -58,7 +59,7 @@ type State = {
containerStyle?: Style,
};
var LayoutEventsTest = React.createClass({
var LayoutEventsTest = createReactClass({
getInitialState(): State {
return {
didAnimation: false,
@@ -10,6 +10,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
var Subscribable = require('Subscribable');
@@ -24,7 +25,7 @@ var reactViewHeight = 102;
var newReactViewWidth = 201;
var newReactViewHeight = 202;
var ReactContentSizeUpdateTest = React.createClass({
var ReactContentSizeUpdateTest = createReactClass({
mixins: [Subscribable.Mixin,
TimerMixin],
@@ -10,6 +10,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
var Subscribable = require('Subscribable');
@@ -22,7 +23,7 @@ var reactViewHeight = 222;
var finalState = false;
var SizeFlexibilityUpdateTest = React.createClass({
var SizeFlexibilityUpdateTest = createReactClass({
mixins: [Subscribable.Mixin],
componentWillMount: function() {
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var TimerMixin = require('react-timer-mixin');
@@ -22,7 +23,7 @@ var {
} = ReactNative;
var { TestModule } = ReactNative.NativeModules;
var TimersTest = React.createClass({
var TimersTest = createReactClass({
mixins: [TimerMixin],
_nextTest: () => {},
@@ -20,6 +20,7 @@ const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
const GRAY = '#999999';
@@ -36,7 +37,7 @@ type DefaultProps = {
/**
* Displays a circular loading indicator.
*/
const ActivityIndicator = React.createClass({
const ActivityIndicator = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -20,6 +20,7 @@ const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -36,7 +37,7 @@ type Event = Object;
* source of truth.
*/
// $FlowFixMe(>=0.41.0)
const DatePickerIOS = React.createClass({
const DatePickerIOS = createReactClass({
// TOOD: Put a better type for _picker
_picker: (undefined: ?$FlowFixMe),
@@ -24,6 +24,7 @@ var ViewPropTypes = require('ViewPropTypes');
var DrawerConsts = UIManager.AndroidDrawerLayout.Constants;
var createReactClass = require('create-react-class');
var dismissKeyboard = require('dismissKeyboard');
var requireNativeComponent = require('requireNativeComponent');
@@ -67,7 +68,7 @@ var DRAWER_STATES = [
* },
* ```
*/
var DrawerLayoutAndroid = React.createClass({
var DrawerLayoutAndroid = createReactClass({
statics: {
positions: DrawerConsts.DrawerPosition,
},
@@ -11,6 +11,7 @@
*/
'use strict';
const createReactClass = require('create-react-class');
const Keyboard = require('Keyboard');
const LayoutAnimation = require('LayoutAnimation');
const Platform = require('Platform');
@@ -53,7 +54,7 @@ const viewRef = 'VIEW';
* It can automatically adjust either its position or bottom padding based on the position of the keyboard.
*/
// $FlowFixMe(>=0.41.0)
const KeyboardAvoidingView = React.createClass({
const KeyboardAvoidingView = createReactClass({
mixins: [TimerMixin],
propTypes: {
@@ -11,10 +11,11 @@
'use strict';
var React = require('React');
var createReactClass = require('create-react-class');
var PropTypes = require('prop-types');
var TimerMixin = require('react-timer-mixin');
var LazyRenderer = React.createClass({
var LazyRenderer = createReactClass({
mixin: [TimerMixin],
propTypes: {
@@ -23,6 +23,7 @@ var TVEventHandler = require('TVEventHandler');
var View = require('View');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var invariant = require('fbjs/lib/invariant');
var logError = require('logError');
var requireNativeComponent = require('requireNativeComponent');
@@ -304,7 +305,7 @@ type Event = Object;
* is pushed.
*
*/
var NavigatorIOS = React.createClass({
var NavigatorIOS = createReactClass({
propTypes: {
@@ -22,10 +22,11 @@ var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var processColor = require('processColor');
var createReactClass = require('create-react-class');
var itemStylePropType = StyleSheetPropType(TextStylePropTypes);
var requireNativeComponent = require('requireNativeComponent');
var PickerIOS = React.createClass({
var PickerIOS = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -16,6 +16,7 @@ var PropTypes = require('prop-types');
var ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
var STYLE_ATTRIBUTES = [
@@ -63,7 +64,7 @@ var indeterminateType = function(props, propName, componentName, ...rest) {
* },
* ```
*/
var ProgressBarAndroid = React.createClass({
var ProgressBarAndroid = createReactClass({
propTypes: {
...ViewPropTypes,
/**
@@ -18,13 +18,14 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
/**
* Use `ProgressViewIOS` to render a UIProgressView on iOS.
*/
// $FlowFixMe(>=0.41.0)
var ProgressViewIOS = React.createClass({
var ProgressViewIOS = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -18,6 +18,7 @@ const React = require('React');
const PropTypes = require('prop-types');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
if (Platform.OS === 'android') {
@@ -72,7 +73,7 @@ if (Platform.OS === 'android') {
* in the `onRefresh` function otherwise the refresh indicator will stop immediately.
*/
// $FlowFixMe(>=0.41.0)
const RefreshControl = React.createClass({
const RefreshControl = createReactClass({
statics: {
SIZE: RefreshLayoutConsts.SIZE,
},
@@ -27,6 +27,7 @@ const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const createReactClass = require('create-react-class');
const dismissKeyboard = require('dismissKeyboard');
const flattenStyle = require('flattenStyle');
const invariant = require('fbjs/lib/invariant');
@@ -69,7 +70,7 @@ const requireNativeComponent = require('requireNativeComponent');
* supports out of the box.
*/
// $FlowFixMe(>=0.41.0)
const ScrollView = React.createClass({
const ScrollView = createReactClass({
propTypes: {
...ViewPropTypes,
/**
@@ -17,6 +17,7 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -49,7 +50,7 @@ type Event = Object;
* ````
*/
// $FlowFixMe(>=0.41.0)
var SegmentedControlIOS = React.createClass({
var SegmentedControlIOS = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -21,6 +21,7 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type Event = Object;
@@ -29,7 +30,7 @@ type Event = Object;
* A component used to select a single value from a range of values.
*/
// $FlowFixMe(>=0.41.0)
var Slider = React.createClass({
var Slider = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -19,6 +19,7 @@ const PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
const ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -38,7 +39,7 @@ type DefaultProps = {
* @keyword toggle
*/
// $FlowFixMe(>=0.41.0)
var Switch = React.createClass({
var Switch = createReactClass({
propTypes: {
...ViewPropTypes,
/**
@@ -17,6 +17,7 @@ const EventEmitter = require('EventEmitter');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const createReactClass = require('create-react-class');
const PropTypes = require('prop-types');
const ReactNative = require('ReactNative');
const StyleSheet = require('StyleSheet');
@@ -168,7 +169,7 @@ const DataDetectorTypes = [
*
*/
// $FlowFixMe(>=0.41.0)
const TextInput = React.createClass({
const TextInput = createReactClass({
statics: {
/* TODO(brentvatne) docs are needed for this */
State: TextInputState,
@@ -20,6 +20,7 @@ var UIManager = require('UIManager');
var ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
var resolveAssetSource = require('resolveAssetSource');
@@ -65,7 +66,7 @@ var optionalImageSource = PropTypes.oneOfType([
*
* [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html
*/
var ToolbarAndroid = React.createClass({
var ToolbarAndroid = createReactClass({
mixins: [NativeMethodsMixin],
propTypes: {
@@ -15,6 +15,7 @@ var Animated = require('Animated');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var createReactClass = require('create-react-class');
var PropTypes = require('prop-types');
var Touchable = require('Touchable');
@@ -35,7 +36,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* interesting interactions such as `handleTouchablePress`.
*/
// $FlowFixMe(>=0.41.0)
var TouchableBounce = React.createClass({
var TouchableBounce = createReactClass({
mixins: [Touchable.Mixin, NativeMethodsMixin],
propTypes: {
@@ -25,6 +25,7 @@ var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var ensureComponentIsNative = require('ensureComponentIsNative');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var keyOf = require('fbjs/lib/keyOf');
@@ -68,7 +69,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* ```
*/
var TouchableHighlight = React.createClass({
var TouchableHighlight = createReactClass({
propTypes: {
...TouchableWithoutFeedback.propTypes,
/**
@@ -18,6 +18,7 @@ var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var UIManager = require('UIManager');
var createReactClass = require('create-react-class');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var processColor = require('processColor');
@@ -70,7 +71,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* ```
*/
var TouchableNativeFeedback = React.createClass({
var TouchableNativeFeedback = createReactClass({
propTypes: {
...TouchableWithoutFeedback.propTypes,
@@ -22,6 +22,7 @@ var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var createReactClass = require('create-react-class');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var flattenStyle = require('flattenStyle');
@@ -51,7 +52,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* },
* ```
*/
var TouchableOpacity = React.createClass({
var TouchableOpacity = createReactClass({
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
propTypes: {
Oops, something went wrong.

0 comments on commit 658c7bb

Please sign in to comment.