1.2.1 • Published 15 days ago
@libtommy2024/quae-officia-enim-voluptatem v1.2.1
Make-Event-Props
A function that, given props, returns an object of event callback props optionally curried with additional arguments.
This package allows you to pass event callback props to a rendered DOM element without the risk of applying any invalid props that could cause unwanted side effects.
tl;dr
- Install by executing
npm install @libtommy2024/quae-officia-enim-voluptatem
oryarn add @libtommy2024/quae-officia-enim-voluptatem
. - Import by adding
import makeEventProps from '@libtommy2024/quae-officia-enim-voluptatem'
. - Create your event props object:
const eventProps = useMemo( () => makeEventProps(props, (eventName) => additionalArgs), [additionalArgs], );
- Use your event props:
return <div {...eventProps} />;
License
The MIT License.