Skip to main content

Type Alias: OnSelectHandler()<T>

OnSelectHandler<T> = (selected, triggerDate, modifiers, e) => void

Defined in: src/types/props.ts:584

Shared handler type for onSelect callback when a selection mode is set.

Type Parameters

Type ParameterDescription
TThe type of the selected item.

Parameters

ParameterTypeDescription
selectedTThe selected item after the event.
triggerDateDateThe date when the event was triggered. This is typically the day clicked or interacted with.
modifiersModifiersThe modifiers associated with the event.
eReact.MouseEvent | React.KeyboardEventThe event object.

Returns

void

Example

const handleSelect: OnSelectHandler<Date> = (
selected,
triggerDate,
modifiers,
e
) => {
console.log("Selected:", selected);
console.log("Triggered by:", triggerDate);
};