From dd0c65c6aa7c80eeeb0783e29bef89399b5796af Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 28 Aug 2016 16:46:53 -0700 Subject: [PATCH] Remove the Mixin layer of indirection on ReactCompositeComponent (#7599) 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 593f3b18b5..6ac4ab1796 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 b0f9ca1110..6a8ed0a54f 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 810f273940..90a7d3ff51 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, } );