mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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`.
This commit is contained in:
committed by
Paul O’Shannessy
parent
04f9887f0e
commit
d889a01caf
@@ -978,7 +978,6 @@ var ReactCompositeComponentMixin = {
|
||||
this._renderedComponent = null;
|
||||
|
||||
ReactComponent.Mixin.unmountComponent.call(this);
|
||||
ReactOwner.Mixin.unmountComponent.call(this);
|
||||
|
||||
// Some existing components rely on this.props even after they've been
|
||||
// destroyed (in event handlers).
|
||||
|
||||
@@ -150,10 +150,6 @@ var ReactOwner = {
|
||||
*/
|
||||
detachRef: function(ref) {
|
||||
delete this.refs[ref];
|
||||
},
|
||||
|
||||
unmountComponent: function() {
|
||||
this.refs = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user