Utilities
Composition
A collection of utility functions for composing event handlers and refs in React components.
Installation
CLI
Manual
Copy and paste the following code into your project.
Usage
Composing Event Handlers
Composing Refs
API Reference
composeEventHandlers
A utility function that composes two event handlers into a single handler.
Prop | Type | Default |
---|---|---|
originalEventHandler | (event: E) => void | - |
ourEventHandler | (event: E) => void | - |
checkForDefaultPrevented | boolean | true |
composeRefs
A utility function that composes multiple refs together.
Prop | Type | Default |
---|---|---|
refs | Ref<T>[] | - |
useComposedRefs
A React hook that composes multiple refs together.
Prop | Type | Default |
---|---|---|
refs | Ref<T>[] | - |