Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit il y a 3 ans
..
dist First Commit il y a 3 ans
src First Commit il y a 3 ans
LICENSE First Commit il y a 3 ans
README.md First Commit il y a 3 ans
package.json First Commit il y a 3 ans

README.md

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:
    get eventProps() {
      return makeEventProps(this.props, () => this.state.pdf);
    }
    
  • Use your event props:
    render() {
      return (
        <div {...this.eventProps} />
      );
    }
    

License

The MIT License.

Author

Wojciech Maj
kontakt@wojtekmaj.pl
http://wojtekmaj.pl