lndsld

Home > @lndsld/react-hooks > useEvent

useEvent() function

Get stable reference to event handler

Signature:

declare function useEvent<P extends unknown[]>(callback: EventCallback<P>): EventCallback<P>;

Parameters

Parameter Type Description
callback EventCallback<P> event handler

Returns:

EventCallback<P>

event handler with stable ref