mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
remove unused state initialValue from ReactDOMFiberSelect (#13412)
This commit is contained in:
committed by
Nathan Hunzaker
parent
9832a1b6d5
commit
cb7745c6cf
@@ -13,7 +13,6 @@ import warning from 'shared/warning';
|
||||
|
||||
import ReactControlledValuePropTypes from '../shared/ReactControlledValuePropTypes';
|
||||
import {getToStringValue, toString} from './ToStringValue';
|
||||
import type {ToStringValue} from './ToStringValue';
|
||||
|
||||
let didWarnValueDefaultValue;
|
||||
|
||||
@@ -23,7 +22,6 @@ if (__DEV__) {
|
||||
|
||||
type SelectWithWrapperState = HTMLSelectElement & {
|
||||
_wrapperState: {
|
||||
initialValue: ?ToStringValue,
|
||||
wasMultiple: boolean,
|
||||
},
|
||||
};
|
||||
@@ -148,9 +146,7 @@ export function initWrapperState(element: Element, props: Object) {
|
||||
checkSelectPropTypes(props);
|
||||
}
|
||||
|
||||
const value = props.value;
|
||||
node._wrapperState = {
|
||||
initialValue: value != null ? value : props.defaultValue,
|
||||
wasMultiple: !!props.multiple,
|
||||
};
|
||||
|
||||
@@ -186,10 +182,6 @@ export function postMountWrapper(element: Element, props: Object) {
|
||||
|
||||
export function postUpdateWrapper(element: Element, props: Object) {
|
||||
const node = ((element: any): SelectWithWrapperState);
|
||||
// After the initial mount, we control selected-ness manually so don't pass
|
||||
// this value down
|
||||
node._wrapperState.initialValue = undefined;
|
||||
|
||||
const wasMultiple = node._wrapperState.wasMultiple;
|
||||
node._wrapperState.wasMultiple = !!props.multiple;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user