@samitouri / QOS-React-2 / commits / d889a01caf

Fix ref behavior for remounting

I'm thinking that setting up `this.refs` in `mountComponent` is better than `construct`. Followed the same pattern as `ReactComponent.Mixin` and nulling out the value in `construct` and setting it to its initial value in `mountComponent`.

Pete Hunt committed Mar 16, 2014 at 21:55 UTC d889a01cafd749a99ea5b6d67f8913cc21b451d1
2 files changed -5
src/core/ReactCompositeComponent.js
-1
@@ -978,7 +978,6 @@ var ReactCompositeComponentMixin = {
978 this._renderedComponent = null;
979
980 ReactComponent.Mixin.unmountComponent.call(this);
981 - ReactOwner.Mixin.unmountComponent.call(this);
981
982 // Some existing components rely on this.props even after they've been
983 // destroyed (in event handlers).
src/core/ReactOwner.js
-4
@@ -150,10 +150,6 @@ var ReactOwner = {
150 */
151 detachRef: function(ref) {
152 delete this.refs[ref];
153 - },
154 -
155 - unmountComponent: function() {
156 - this.refs = null;
153 }
154
155 }