$ cnpm install 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.
npm install make-event-props or yarn add make-event-props.import makeEventProps from 'make-event-props'.const eventProps = useMemo(
() => makeEventProps(props, (eventName) => additionalArgs),
[additionalArgs],
);
return <div {...eventProps} />;
The MIT License.
|
|
Wojciech Maj |
Copyright 2013 - present © cnpmjs.org | Home |