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.
Christopher Chedeau committed
Aug 28, 2016 at 16:46 UTC
dd0c65c6aa7c80eeeb0783e29bef89399b5796af
3 files changed
+5
-11
src/renderers/shared/stack/reconciler/ReactCompositeComponent.js
+1
-7
@@ -126,7 +126,7 @@ var nextMountID = 1;
126
/**
127
* @lends {ReactCompositeComponent.prototype}
128
*/
129
-var ReactCompositeComponentMixin = {
129
+var ReactCompositeComponent = {
130
131
/**
132
* Base constructor for all composite component.
@@ -1169,10 +1169,4 @@ var ReactCompositeComponentMixin = {
1169
1170
};
1171
1172
-var ReactCompositeComponent = {
1173
-
1174
- Mixin: ReactCompositeComponentMixin,
1175
-
1176
-};
1177
-
1172
module.exports = ReactCompositeComponent;
src/renderers/shared/stack/reconciler/instantiateReactComponent.js
+1
-1
@@ -24,7 +24,7 @@ var ReactCompositeComponentWrapper = function(element) {
24
};
25
Object.assign(
26
ReactCompositeComponentWrapper.prototype,
27
- ReactCompositeComponent.Mixin,
27
+ ReactCompositeComponent,
28
{
29
_instantiateReactComponent: instantiateReactComponent,
30
}
src/test/ReactTestUtils.js
+3
-3
@@ -419,15 +419,15 @@ var ShallowComponentWrapper = function(element) {
419
};
420
Object.assign(
421
ShallowComponentWrapper.prototype,
422
- ReactCompositeComponent.Mixin, {
422
+ ReactCompositeComponent, {
423
_constructComponent:
424
- ReactCompositeComponent.Mixin._constructComponentWithoutOwner,
424
+ ReactCompositeComponent._constructComponentWithoutOwner,
425
_instantiateReactComponent: function(element) {
426
return new NoopInternalComponent(element);
427
},
428
_replaceNodeWithMarkup: function() {},
429
_renderValidatedComponent:
430
- ReactCompositeComponent.Mixin
430
+ ReactCompositeComponent
431
._renderValidatedComponentWithoutOwnerOrContext,
432
}
433
);