Skip to main content

Function: useModalHandlersWithCallbacks()

useModalHandlersWithCallbacks(setShowModal: StateSetter<boolean>, onOpen?: () => void, onClose?: () => void): { close: () => void; open: () => void; }

Defined in: shared/utils/modalHandlers.ts:174

Creates handlers for modal interactions with additional context.

Parametersโ€‹

setShowModalโ€‹

StateSetter<boolean>

State setter function for the modal visibility

onOpen?โ€‹

() => void

Optional callback to run when opening

onClose?โ€‹

() => void

Optional callback to run when closing

Returnsโ€‹

{ close: () => void; open: () => void; }

Object with open and close handlers

close()โ€‹

close: () => void

Returnsโ€‹

void

open()โ€‹

open: () => void

Returnsโ€‹

void

Remarksโ€‹

Utility for creating handlers that need to perform additional actions when opening or closing modals.