Skip to content

Commit 7d19cf1

Browse files
committed
Ensure check is a boolean (function/symbol are false)
1 parent d741e00 commit 7d19cf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-dom-bindings/src/client/ReactDOMInput.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ export function initWrapperState(element: Element, props: Object) {
103103

104104
const node = ((element: any): InputWithWrapperState);
105105
const defaultValue = props.defaultValue == null ? '' : props.defaultValue;
106+
const initialChecked = props.checked != null ? props.checked : defaultChecked;
106107
node._wrapperState = {
107108
initialChecked:
108-
props.checked != null ? props.checked : props.defaultChecked,
109+
typeof initialChecked !== 'function' &&
110+
typeof initialChecked !== 'symbol' &&
111+
!!initialChecked,
109112
initialValue: getToStringValue(
110113
props.value != null ? props.value : defaultValue,
111114
),

0 commit comments

Comments
 (0)