This repository has been archived on 2026-07-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drive/frontend/node_modules/make-event-props/README.md
Elijah 267d429122
Some checks failed
Automated Container Build / build-and-push (push) Failing after 8s
Numerous Bug Fixes
2026-05-22 15:50:45 -07:00

40 lines
1.3 KiB
Markdown

[![npm](https://img.shields.io/npm/v/make-event-props.svg)](https://www.npmjs.com/package/make-event-props) ![downloads](https://img.shields.io/npm/dt/make-event-props.svg) [![CI](https://github.com/wojtekmaj/make-event-props/actions/workflows/ci.yml/badge.svg)](https://github.com/wojtekmaj/make-event-props/actions)
# 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 make-event-props` or `yarn add make-event-props`.
- Import by adding `import makeEventProps from 'make-event-props'`.
- Create your event props object:
```ts
const eventProps = useMemo(
() => makeEventProps(props, (eventName) => additionalArgs),
[additionalArgs],
);
```
- Use your event props:
```tsx
return <div {...eventProps} />;
```
## License
The MIT License.
## Author
<table>
<tr>
<td >
<img src="https://avatars.githubusercontent.com/u/5426427?v=4&s=128" width="64" height="64" alt="Wojciech Maj">
</td>
<td>
<a href="https://github.com/wojtekmaj">Wojciech Maj</a>
</td>
</tr>
</table>