Callbacks
Long press lifecycle callbacks
Structure
All callbacks (including main callback function) has the same structure.
Pseudocode
TypeScript
As a first argument callback receives React event from a proper handler (e.g. onMouseDown
) and as second receives meta object with following structure:
Pseudocode
Pseudocode
TypeScript
Both object properties are optional.
Context
context
will be present if you pass it to bind function. See context for more info.
Reason
reason
will be present in onCancel callback to indicate why long press was cancelled.
Here is a list of all possible reason values
Javascript
TypeScript
Last updated