You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.1 KiB

3 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Make-Event-Props
  2. A function that, given props, returns an object of event callback props optionally curried with additional arguments.
  3. 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.
  4. ## tl;dr
  5. * Install by executing `npm install make-event-props` or `yarn add make-event-props`.
  6. * Import by adding `import makeEventProps from 'make-event-props'`.
  7. * Create your event props object:
  8. ```js
  9. get eventProps() {
  10. return makeEventProps(this.props, () => this.state.pdf);
  11. }
  12. ```
  13. * Use your event props:
  14. ```js
  15. render() {
  16. return (
  17. <div {...this.eventProps} />
  18. );
  19. }
  20. ```
  21. ## License
  22. The MIT License.
  23. ## Author
  24. <table>
  25. <tr>
  26. <td>
  27. <img src="https://github.com/wojtekmaj.png?s=100" width="100">
  28. </td>
  29. <td>
  30. Wojciech Maj<br />
  31. <a href="mailto:kontakt@wojtekmaj.pl">kontakt@wojtekmaj.pl</a><br />
  32. <a href="http://wojtekmaj.pl">http://wojtekmaj.pl</a>
  33. </td>
  34. </tr>
  35. </table>