mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #3970 from jimfb/remove-_context
Removed ReactElement._context (cleanup)
This commit is contained in:
commit
74915803a8
4 files changed
+4
-9
No files matched your search
@@ -11,7 +11,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var ReactContext = require('ReactContext');
|
||||
var ReactCurrentOwner = require('ReactCurrentOwner');
|
||||
|
||||
var assign = require('Object.assign');
|
||||
@@ -85,12 +84,13 @@ function defineMutationMembrane(prototype) {
|
||||
* work with a dynamic instanceof check. Nothing should live on this prototype.
|
||||
*
|
||||
* @param {*} type
|
||||
* @param {string|object} ref
|
||||
* @param {*} key
|
||||
* @param {string|object} ref
|
||||
* @param {*} owner
|
||||
* @param {*} props
|
||||
* @internal
|
||||
*/
|
||||
var ReactElement = function(type, key, ref, owner, context, props) {
|
||||
var ReactElement = function(type, key, ref, owner, props) {
|
||||
// Built-in properties that belong on the element
|
||||
this.type = type;
|
||||
this.key = key;
|
||||
@@ -191,7 +191,6 @@ ReactElement.createElement = function(type, config, children) {
|
||||
key,
|
||||
ref,
|
||||
ReactCurrentOwner.current,
|
||||
ReactContext.current,
|
||||
props
|
||||
);
|
||||
};
|
||||
@@ -213,7 +212,6 @@ ReactElement.cloneAndReplaceProps = function(oldElement, newProps) {
|
||||
oldElement.key,
|
||||
oldElement.ref,
|
||||
oldElement._owner,
|
||||
oldElement._context,
|
||||
newProps
|
||||
);
|
||||
|
||||
@@ -273,7 +271,6 @@ ReactElement.cloneElement = function(element, config, children) {
|
||||
key,
|
||||
ref,
|
||||
owner,
|
||||
element._context,
|
||||
props
|
||||
);
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ function cloneWithProps(child, props) {
|
||||
newProps.children = child.props.children;
|
||||
}
|
||||
|
||||
// The current API doesn't retain _owner and _context, which is why this
|
||||
// The current API doesn't retain _owner, which is why this
|
||||
// doesn't use ReactElement.cloneAndReplaceProps.
|
||||
return ReactElement.createElement(child.type, newProps);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ function autoGenerateWrapperClass(type) {
|
||||
null, // key
|
||||
null, // ref
|
||||
internalInstance._currentElement._owner, // owner
|
||||
null, // context
|
||||
this.props
|
||||
);
|
||||
}
|
||||
|
||||
@@ -400,7 +400,6 @@ describe('ReactDOMComponent', function() {
|
||||
type: StubNativeComponent,
|
||||
props: props,
|
||||
_owner: null,
|
||||
_context: null
|
||||
});
|
||||
return stubComponent.mountComponent('test', transaction, {});
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user