Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/renderers/dom/client/wrappers/ReactDOMInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ var ReactDOMInput = {
initialValue: defaultValue != null ? defaultValue : null,
onChange: _handleChange.bind(inst),
};
},

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

Expand Down
4 changes: 3 additions & 1 deletion src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,10 @@ ReactDOMComponent.Mixin = {
}

switch (this._tag) {
case 'button':
case 'input':
ReactDOMInput.mountReadyWrapper(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something here? It appears execution still continues after the markup is created to this call, even on the server-side.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yes. oops. thank you for catching that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// falls through
case 'button':
case 'select':
case 'textarea':
if (props.autoFocus) {
Expand Down