Drop inaccessible methods
These are no longer accessible and the isOwnedBy check is only used in a method that is not accessible.
Sebastian Markbage committed
Nov 16, 2014 at 00:37 UTC
8181272fe8e4897391335b14b0c9aac3db4bd3c9
2 files changed
-35
src/core/ReactComponent.js
-28
@@ -416,34 +416,6 @@ var ReactComponent = {
416
mountImageIntoNode(markup, container, shouldReuseMarkup);
417
},
418
419
- /**
420
- * Checks if this component is owned by the supplied `owner` component.
421
- *
422
- * @param {ReactComponent} owner Component to check.
423
- * @return {boolean} True if `owners` owns this component.
424
- * @final
425
- * @internal
426
- */
427
- isOwnedBy: function(owner) {
428
- return this._owner === owner;
429
- },
430
-
431
- /**
432
- * Gets another component, that shares the same owner as this one, by ref.
433
- *
434
- * @param {string} ref of a sibling Component.
435
- * @return {?ReactComponent} the actual sibling Component.
436
- * @final
437
- * @internal
438
- */
439
- getSiblingByRef: function(ref) {
440
- var owner = this._owner;
441
- if (!owner || !owner.refs) {
442
- return null;
443
- }
444
- return owner.refs[ref];
445
- },
446
-
419
/**
420
* Get the publicly accessible representation of this component - i.e. what
421
* is exposed by refs and renderComponent. Can be null for stateless
src/core/ReactOwner.js
-7
@@ -126,13 +126,6 @@ var ReactOwner = {
126
* @private
127
*/
128
attachRef: function(ref, component) {
129
- // TODO: Remove this invariant. This is never exposed and cannot be called
130
- // by user code. The unit test is already removed.
131
- invariant(
132
- component.isOwnedBy(this),
133
- 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.',
134
- ref
135
- );
129
var inst = this.getPublicInstance();
130
var refs = inst.refs === emptyObject ? (inst.refs = {}) : inst.refs;
131
refs[ref] = component.getPublicInstance();