react-event-utils
Shorthand utils for dealing with React events
Install
$ yarn add react-event-utils
About
This library exposes shorthand methods that call event methods for you.
This will allow you to stop having components like this:
Component { ; thishandleSubmit = thishandleSubmit; } { e; ; } { return <form => <input ="text" ="title" /> </form> ; }
While you could just write:
import preventDefault /*, persist, stopPropagation */ from 'react-event-utils'; const Form = <form => <input ="text" ="title" /> </form>;
Currently persist
, preventDefault
and stopPropagation
are implemented.
License
MIT © Bertrand Marron