Skip to content

Commit 838d64a

Browse files
authored
fix(MenuToggle): incorrect inheritance of HTMLInputElement (#11145)
MenuToggleCheckboxProps inherits from HTMLInputElement and defaultChecked is typed there as `undefined | boolean`, null is not a valid type. Found by typescript's `tsc` in strict mode.
1 parent e80c120 commit 838d64a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-core/src/components/MenuToggle/MenuToggleCheckbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface MenuToggleCheckboxProps
2020
/** Flag to set the default checked value of the checkbox when it is uncontrolled by React state.
2121
* To make the checkbox controlled instead use the isChecked prop, but do not use both.
2222
*/
23-
defaultChecked?: boolean | null;
23+
defaultChecked?: boolean;
2424
/** A callback for when the checkbox selection changes */
2525
onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
2626
/** Element to be rendered inside the <span> */

0 commit comments

Comments
 (0)