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

remove unused state initialValue from ReactDOMFiberSelect (#13412)

Kartik Lad committed Aug 17, 2018 at 00:55 UTC cb7745c6cf13841a7cfbe4cd6868bdc7a00f2f26
1 file changed -8
packages/react-dom/src/client/ReactDOMFiberSelect.js
-8
@@ -13,7 +13,6 @@ import warning from 'shared/warning';
13
14 import ReactControlledValuePropTypes from '../shared/ReactControlledValuePropTypes';
15 import {getToStringValue, toString} from './ToStringValue';
16 -import type {ToStringValue} from './ToStringValue';
16
17 let didWarnValueDefaultValue;
18
@@ -23,7 +22,6 @@ if (__DEV__) {
22
23 type SelectWithWrapperState = HTMLSelectElement & {
24 _wrapperState: {
26 - initialValue: ?ToStringValue,
25 wasMultiple: boolean,
26 },
27 };
@@ -148,9 +146,7 @@ export function initWrapperState(element: Element, props: Object) {
146 checkSelectPropTypes(props);
147 }
148
151 - const value = props.value;
149 node._wrapperState = {
153 - initialValue: value != null ? value : props.defaultValue,
150 wasMultiple: !!props.multiple,
151 };
152
@@ -186,10 +182,6 @@ export function postMountWrapper(element: Element, props: Object) {
182
183 export function postUpdateWrapper(element: Element, props: Object) {
184 const node = ((element: any): SelectWithWrapperState);
189 - // After the initial mount, we control selected-ness manually so don't pass
190 - // this value down
191 - node._wrapperState.initialValue = undefined;
192 -
185 const wasMultiple = node._wrapperState.wasMultiple;
186 node._wrapperState.wasMultiple = !!props.multiple;
187