mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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.
This commit is contained in:
committed by
GitHub
parent
dbe3584340
commit
dd0c65c6aa
@@ -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;
|
||||
|
||||
@@ -24,7 +24,7 @@ var ReactCompositeComponentWrapper = function(element) {
|
||||
};
|
||||
Object.assign(
|
||||
ReactCompositeComponentWrapper.prototype,
|
||||
ReactCompositeComponent.Mixin,
|
||||
ReactCompositeComponent,
|
||||
{
|
||||
_instantiateReactComponent: instantiateReactComponent,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user