@@ -16,12 +16,12 @@ var ReactContext = require('ReactContext');
1616var ReactCurrentOwner = require ( 'ReactCurrentOwner' ) ;
1717var ReactElement = require ( 'ReactElement' ) ;
1818var ReactInstanceMap = require ( 'ReactInstanceMap' ) ;
19- var ReactOwner = require ( 'ReactOwner' ) ;
2019var ReactPerf = require ( 'ReactPerf' ) ;
2120var ReactPropTypeLocations = require ( 'ReactPropTypeLocations' ) ;
2221var ReactUpdates = require ( 'ReactUpdates' ) ;
2322
2423var assign = require ( 'Object.assign' ) ;
24+ var emptyObject = require ( 'emptyObject' ) ;
2525var invariant = require ( 'invariant' ) ;
2626var keyMirror = require ( 'keyMirror' ) ;
2727var shouldUpdateReactComponent = require ( 'shouldUpdateReactComponent' ) ;
@@ -100,8 +100,7 @@ var CompositeLifeCycle = keyMirror({
100100 * @lends {ReactCompositeComponent.prototype}
101101 */
102102var ReactCompositeComponentMixin = assign ( { } ,
103- ReactComponent . Mixin ,
104- ReactOwner . Mixin , {
103+ ReactComponent . Mixin , {
105104
106105 /**
107106 * Base constructor for all composite component.
@@ -114,13 +113,13 @@ var ReactCompositeComponentMixin = assign({},
114113 this . _instance . props = element . props ;
115114 this . _instance . state = null ;
116115 this . _instance . context = null ;
116+ this . _instance . refs = emptyObject ;
117117
118118 this . _pendingState = null ;
119119 this . _compositeLifeCycleState = null ;
120120
121121 // Children can be either an array or more than one argument
122122 ReactComponent . Mixin . construct . apply ( this , arguments ) ;
123- ReactOwner . Mixin . construct . apply ( this , arguments ) ;
124123 } ,
125124
126125 /**
@@ -699,6 +698,32 @@ var ReactCompositeComponentMixin = assign({},
699698 }
700699 ) ,
701700
701+ /**
702+ * Lazily allocates the refs object and stores `component` as `ref`.
703+ *
704+ * @param {string } ref Reference name.
705+ * @param {component } component Component to store as `ref`.
706+ * @final
707+ * @private
708+ */
709+ attachRef : function ( ref , component ) {
710+ var inst = this . getPublicInstance ( ) ;
711+ var refs = inst . refs === emptyObject ? ( inst . refs = { } ) : inst . refs ;
712+ refs [ ref ] = component . getPublicInstance ( ) ;
713+ } ,
714+
715+ /**
716+ * Detaches a reference name.
717+ *
718+ * @param {string } ref Name to dereference.
719+ * @final
720+ * @private
721+ */
722+ detachRef : function ( ref ) {
723+ var refs = this . getPublicInstance ( ) . refs ;
724+ delete refs [ ref ] ;
725+ } ,
726+
702727 /**
703728 * Get the publicly accessible representation of this component - i.e. what
704729 * is exposed by refs and renderComponent. Can be null for stateless
0 commit comments