make-event-props
Returns an object with on-event callback props curried with provided args.
Last updated a year ago by wojtekmaj .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install make-event-props 
SYNC missed versions from official npm registry.

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

Wojciech Maj Wojciech Maj

Current Tags

  • 2.0.0                                ...           latest (a year ago)

14 Versions

  • 2.0.0                                ...           a year ago
  • 1.6.2                                ...           2 years ago
  • 1.6.1                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.4.4                                ...           3 years ago
  • 1.4.3                                ...           3 years ago
  • 1.4.2                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |