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

Don't store <input> instance until mount-ready

Fixes #4870. This more or less matches what we were doing with the old wrapper components (not storing until componentDidMount).

Ben Alpert committed Sep 25, 2015 at 13:20 UTC c04d10f03386db2c9f1b3b2ab61cfbea681f0996
2 files changed +6 -1
src/renderers/dom/client/wrappers/ReactDOMInput.js
+3
@@ -75,7 +75,10 @@ var ReactDOMInput = {
75 initialValue: defaultValue != null ? defaultValue : null,
76 onChange: _handleChange.bind(inst),
77 };
78 + },
79
80 + mountReadyWrapper: function(inst) {
81 + // Can't be in mountWrapper or else server rendering leaks.
82 instancesByReactID[inst._rootNodeID] = inst;
83 },
84
src/renderers/dom/shared/ReactDOMComponent.js
+3 -1
@@ -606,8 +606,10 @@ ReactDOMComponent.Mixin = {
606 }
607
608 switch (this._tag) {
609 - case 'button':
609 case 'input':
610 + ReactDOMInput.mountReadyWrapper(this);
611 + // falls through
612 + case 'button':
613 case 'select':
614 case 'textarea':
615 if (props.autoFocus) {