Remove old reference to inst._wrapperState (#12987)

This commit removes a reference to inst._wrapperState, which was the
old way of tracking input state in the stack renderer.

This means we no longer need to pass the instance into the associated
function, allowing us to eliminate an exception for IE (and a TODO).
This commit is contained in:
Nathan Hunzaker 2018-06-11 09:16:50 -04:00 committed by Dan Abramov
parent c78957eac8
commit d0d4280640
1 changed files with 3 additions and 9 deletions

View File

@ -231,14 +231,8 @@ function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
}
}
function handleControlledInputBlur(inst, node) {
// TODO: In IE, inst is occasionally null. Why?
if (inst == null) {
return;
}
// Fiber and ReactDOM keep wrapper state in separate places
let state = inst._wrapperState || node._wrapperState;
function handleControlledInputBlur(node) {
let state = node._wrapperState;
if (!state || !state.controlled || node.type !== 'number') {
return;
@ -303,7 +297,7 @@ const ChangeEventPlugin = {
// When blurring, set the value attribute for number inputs
if (topLevelType === TOP_BLUR) {
handleControlledInputBlur(targetInst, targetNode);
handleControlledInputBlur(targetNode);
}
},
};