Home > @lndsld/react-hooks > useEvent
Get stable reference to event handler
Signature:
declare function useEvent<P extends unknown[]>(callback: EventCallback<P>): EventCallback<P>;
Parameter | Type | Description |
---|---|---|
callback | EventCallback<P> | event handler |
Returns:
event handler with stable ref