Skip to content

Commit e4aeee8

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ 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 =
107+
props.checked != null ? props.checked : props.defaultChecked;
106108
node._wrapperState = {
107109
initialChecked:
108-
props.checked != null ? props.checked : props.defaultChecked,
110+
typeof initialChecked !== 'function' &&
111+
typeof initialChecked !== 'symbol' &&
112+
!!initialChecked,
109113
initialValue: getToStringValue(
110114
props.value != null ? props.value : defaultValue,
111115
),

0 commit comments

Comments
 (0)