From 9b13ea828da86d8f8c7c3657efd3e73ae0653e4d Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 28 Aug 2016 12:53:41 -0700 Subject: [PATCH] Remove the Mixin layer of indirection on ReactCompositeComponent As mentioned in https://github.com/facebook/react/pull/7581#issuecomment-242952042 we can remove the Mixin layer of indirection as it only exports a Mixin and I find it confusing. --- .../shared/stack/reconciler/ReactCompositeComponent.js | 8 +------- .../shared/stack/reconciler/instantiateReactComponent.js | 2 +- src/test/ReactTestUtils.js | 6 +++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js index 593f3b18b50..6ac4ab1796b 100644 --- a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js +++ b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js @@ -126,7 +126,7 @@ var nextMountID = 1; /** * @lends {ReactCompositeComponent.prototype} */ -var ReactCompositeComponentMixin = { +var ReactCompositeComponent = { /** * Base constructor for all composite component. @@ -1169,10 +1169,4 @@ var ReactCompositeComponentMixin = { }; -var ReactCompositeComponent = { - - Mixin: ReactCompositeComponentMixin, - -}; - module.exports = ReactCompositeComponent; diff --git a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js index b0f9ca1110b..6a8ed0a54ff 100644 --- a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js +++ b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js @@ -24,7 +24,7 @@ var ReactCompositeComponentWrapper = function(element) { }; Object.assign( ReactCompositeComponentWrapper.prototype, - ReactCompositeComponent.Mixin, + ReactCompositeComponent, { _instantiateReactComponent: instantiateReactComponent, } diff --git a/src/test/ReactTestUtils.js b/src/test/ReactTestUtils.js index 810f2739408..90a7d3ff51d 100644 --- a/src/test/ReactTestUtils.js +++ b/src/test/ReactTestUtils.js @@ -419,15 +419,15 @@ var ShallowComponentWrapper = function(element) { }; Object.assign( ShallowComponentWrapper.prototype, - ReactCompositeComponent.Mixin, { + ReactCompositeComponent, { _constructComponent: - ReactCompositeComponent.Mixin._constructComponentWithoutOwner, + ReactCompositeComponent._constructComponentWithoutOwner, _instantiateReactComponent: function(element) { return new NoopInternalComponent(element); }, _replaceNodeWithMarkup: function() {}, _renderValidatedComponent: - ReactCompositeComponent.Mixin + ReactCompositeComponent ._renderValidatedComponentWithoutOwnerOrContext, } );