Skip to content

Commit 6bfbdb9

Browse files
committed
initialValue in Input wrapperState is always a string
1 parent 8c1343d commit 6bfbdb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-dom/src/client/ReactDOMFiberInput.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import {getFiberCurrentPropsFromNode} from './ReactDOMComponentTree';
1717
import ReactControlledValuePropTypes from '../shared/ReactControlledValuePropTypes';
1818

1919
type InputWithWrapperState = HTMLInputElement & {
20+
value: string,
21+
defaultValue: string,
2022
_wrapperState: {
21-
initialValue: ?string,
23+
initialValue: string,
2224
initialChecked: ?boolean,
2325
controlled?: boolean,
2426
},
@@ -300,7 +302,7 @@ function updateNamedCousins(rootNode, props) {
300302
// when the user is inputting text
301303
//
302304
// https://github.com/facebook/react/issues/7253
303-
function synchronizeDefaultValue(node: Element, type: ?string, value: string) {
305+
function synchronizeDefaultValue(node: InputWithWrapperState, type: ?string, value: string) {
304306
if (
305307
// Focused number inputs synchronize on blur. See ChangeEventPlugin.js
306308
(type !== 'number' || node.ownerDocument.activeElement !== node) &&

0 commit comments

Comments
 (0)