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 e4aeee8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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,13 @@ 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 : props.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 e4aeee8

Please sign in to comment.