Skip to content

useEvent

Hook that creates an event and returns a stable reference of it

utilities
high
test coverage
Last changed: 6 months ago

Installation

Library
CLI
Manual
typescript
import { useEvent } from '@siberiacancode/reactuse';

Usage

typescript
const onClick = useEvent(() => console.log('clicked'));
## Demo

Api

Parameters

NameTypeDefaultNote
callback(...args: Params) => Return-The callback function

Returns

(...args: Params) => Return

Source

SourceDemo

Contributors

D
debabin
debabin
H
hywax
hywax

Released under the MIT License.