Skip to main content

Function: createCheckboxChangeHandler()

createCheckboxChangeHandler(setValue: (value: boolean) => void): (event: ChangeEvent<HTMLInputElement>) => void

Defined in: src/components/shared/formUtils.ts:155

Creates a standardized handler for checkbox changes

Parametersโ€‹

setValueโ€‹

(value: boolean) => void

State setter function

Returnsโ€‹

Checkbox change handler

(event: ChangeEvent<HTMLInputElement>): void

Parametersโ€‹

eventโ€‹

ChangeEvent<HTMLInputElement>

Returnsโ€‹

void

Exampleโ€‹

const handleNotificationsChange = createCheckboxChangeHandler(setNotifications);