useDoubleClick ​
sensors
test coverage
Last changed: 22 hours ago
Hook that defines the logic when double clicking an element
typescript
import { useDoubleClick } from '@siberiacancode/reactuse';
Usage ​
typescript
useDoubleClick(ref, () => console.log('double clicked'));
// or
const ref = useDoubleClick(() => console.log('double clicked'));
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
target | HookTarget | - | The target element to be double clicked |
callback | (event: DoubleClickEvents) => void | - | The callback function to be invoked on double click |
options? | UseDoubleClickOptions | - | The options for the double click |
Returns
boolean
Parameters
Name | Type | Default | Note |
---|---|---|---|
callback | (event: DoubleClickEvents) => void | - | The callback function to be invoked on double click |
options? | UseDoubleClickOptions | - | The options for the double click |
Returns
boolean