Skip to content

Commit

Permalink
Ensure check is a boolean (function/symbol are false)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 29, 2023
1 parent d741e00 commit 7d19cf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-dom-bindings/src/client/ReactDOMInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ export function initWrapperState(element: Element, props: Object) {

const node = ((element: any): InputWithWrapperState);
const defaultValue = props.defaultValue == null ? '' : props.defaultValue;
const initialChecked = props.checked != null ? props.checked : defaultChecked;
node._wrapperState = {
initialChecked:
props.checked != null ? props.checked : props.defaultChecked,
typeof initialChecked !== 'function' &&
typeof initialChecked !== 'symbol' &&
!!initialChecked,
initialValue: getToStringValue(
props.value != null ? props.value : defaultValue,
),
Expand Down

0 comments on commit 7d19cf1

Please sign in to comment.