Skip to content

Commit b82f3ab

Browse files
committed
Merge pull request #4976 from spicyj/gh-4870
Don't store <input> instance until mount-ready
2 parents c05a657 + c04d10f commit b82f3ab

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/renderers/dom/client/wrappers/ReactDOMInput.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ var ReactDOMInput = {
7575
initialValue: defaultValue != null ? defaultValue : null,
7676
onChange: _handleChange.bind(inst),
7777
};
78+
},
7879

80+
mountReadyWrapper: function(inst) {
81+
// Can't be in mountWrapper or else server rendering leaks.
7982
instancesByReactID[inst._rootNodeID] = inst;
8083
},
8184

src/renderers/dom/shared/ReactDOMComponent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,10 @@ ReactDOMComponent.Mixin = {
606606
}
607607

608608
switch (this._tag) {
609-
case 'button':
610609
case 'input':
610+
ReactDOMInput.mountReadyWrapper(this);
611+
// falls through
612+
case 'button':
611613
case 'select':
612614
case 'textarea':
613615
if (props.autoFocus) {

0 commit comments

Comments
 (0)