@samitouri / QOS-React-2 / commits / c3c98084b9

Rename ReactComponentBase -> ReactComponent

We freed up this internal name by removing the internal base class. We're now free to use this name as it was intended. ReactDOMComponent and ReactCompositeComponent are still confusing as they're internal but we'll rename them later.

Sebastian Markbage committed Jan 27, 2015 at 09:22 UTC c3c98084b94a359adbfcf84b88b3c901aade50b9
3 files changed +14 -14
src/browser/ui/React.js
+2 -2
@@ -16,7 +16,7 @@
16 var DOMPropertyOperations = require('DOMPropertyOperations');
17 var EventPluginUtils = require('EventPluginUtils');
18 var ReactChildren = require('ReactChildren');
19 -var ReactComponentBase = require('ReactComponentBase');
19 +var ReactComponent = require('ReactComponent');
20 var ReactClass = require('ReactClass');
21 var ReactContext = require('ReactContext');
22 var ReactCurrentOwner = require('ReactCurrentOwner');
@@ -56,7 +56,7 @@ var React = {
56 count: ReactChildren.count,
57 only: onlyChild
58 },
59 - Component: ReactComponentBase,
59 + Component: ReactComponent,
60 DOM: ReactDOM,
61 PropTypes: ReactPropTypes,
62 initializeTouchEvents: function(shouldUseTouch) {
src/classic/class/ReactClass.js
+6 -6
@@ -11,7 +11,7 @@
11
12 'use strict';
13
14 -var ReactComponentBase = require('ReactComponentBase');
14 +var ReactComponent = require('ReactComponent');
15 var ReactElement = require('ReactElement');
16 var ReactErrorUtils = require('ReactErrorUtils');
17 var ReactInstanceMap = require('ReactInstanceMap');
@@ -712,7 +712,7 @@ var typeDeprecationDescriptor = {
712
713 /**
714 * Add more to the ReactClass base class. These are all legacy features and
715 - * therefore not already part of the modern ReactComponentBase.
715 + * therefore not already part of the modern ReactComponent.
716 */
717 var ReactClassMixin = {
718
@@ -774,10 +774,10 @@ var ReactClassMixin = {
774 }
775 };
776
777 -var ReactClassBase = function() {};
777 +var ReactClassComponent = function() {};
778 assign(
779 - ReactClassBase.prototype,
780 - ReactComponentBase.prototype,
779 + ReactClassComponent.prototype,
780 + ReactComponent.prototype,
781 ReactClassMixin
782 );
783
@@ -830,7 +830,7 @@ var ReactClass = {
830
831 this.state = initialState;
832 };
833 - Constructor.prototype = new ReactClassBase();
833 + Constructor.prototype = new ReactClassComponent();
834 Constructor.prototype.constructor = Constructor;
835
836 injectedMixins.forEach(
src/modern/class/ReactComponent.js renamed
+6 -6
@@ -6,7 +6,7 @@
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 - * @providesModule ReactComponentBase
9 + * @providesModule ReactComponent
10 */
11
12 'use strict';
@@ -19,7 +19,7 @@ var warning = require('warning');
19 /**
20 * Base class helpers for the updating state of a component.
21 */
22 -function ReactComponentBase(props, context) {
22 +function ReactComponent(props, context) {
23 this.props = props;
24 this.context = context;
25 }
@@ -41,7 +41,7 @@ function ReactComponentBase(props, context) {
41 * @final
42 * @protected
43 */
44 -ReactComponentBase.prototype.setState = function(partialState, callback) {
44 +ReactComponent.prototype.setState = function(partialState, callback) {
45 invariant(
46 typeof partialState === 'object' || partialState == null,
47 'setState(...): takes an object of state variables to update.'
@@ -73,7 +73,7 @@ ReactComponentBase.prototype.setState = function(partialState, callback) {
73 * @final
74 * @protected
75 */
76 -ReactComponentBase.prototype.forceUpdate = function(callback) {
76 +ReactComponent.prototype.forceUpdate = function(callback) {
77 ReactUpdateQueue.enqueueForceUpdate(this);
78 if (callback) {
79 ReactUpdateQueue.enqueueCallback(this, callback);
@@ -94,7 +94,7 @@ if (__DEV__) {
94 setProps: 'setProps'
95 };
96 var defineDeprecationWarning = function(methodName, displayName) {
97 - Object.defineProperty(ReactComponentBase.prototype, methodName, {
97 + Object.defineProperty(ReactComponent.prototype, methodName, {
98 get: function() {
99 warning(
100 false,
@@ -113,4 +113,4 @@ if (__DEV__) {
113 }
114 }
115
116 -module.exports = ReactComponentBase;
116 +module.exports = ReactComponent;