@samitouri / QOS-React / commits / d0d4280640

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).

Nathan Hunzaker committed Jun 11, 2018 at 09:16 UTC d0d4280640967eca2faad0d96be6fca08ac846a6
1 file changed +3 -9
packages/react-dom/src/events/ChangeEventPlugin.js
+3 -9
@@ -231,14 +231,8 @@ function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
231 }
232 }
233
234 -function handleControlledInputBlur(inst, node) {
235 - // TODO: In IE, inst is occasionally null. Why?
236 - if (inst == null) {
237 - return;
238 - }
239 -
240 - // Fiber and ReactDOM keep wrapper state in separate places
241 - let state = inst._wrapperState || node._wrapperState;
234 +function handleControlledInputBlur(node) {
235 + let state = node._wrapperState;
236
237 if (!state || !state.controlled || node.type !== 'number') {
238 return;
@@ -303,7 +297,7 @@ const ChangeEventPlugin = {
297
298 // When blurring, set the value attribute for number inputs
299 if (topLevelType === TOP_BLUR) {
306 - handleControlledInputBlur(targetInst, targetNode);
300 + handleControlledInputBlur(targetNode);
301 }
302 },
303 };