1.6.2 • Published 7 months ago

make-event-props v1.6.2

Weekly downloads
349,623
License
MIT
Repository
github
Last release
7 months ago

npm downloads CI

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:
    const eventProps = useMemo(
      () => makeEventProps(props, (eventName) => additionalArgs),
      [additionalArgs],
    );
  • Use your event props:
    return <div {...eventProps} />;

License

The MIT License.

Author

1.6.2

7 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.4.4

1 year ago

1.4.3

1 year ago

1.5.0

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

3 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago