react-click-keypress
v1.1.0
Published
Spread a click & enter/space key event on an element
Downloads
42
Maintainers
Readme
react-click-keypress
Spread a click & enter/space key event on an element
Install
$ npm install --save react-click-keypress
Usage
var clickKeyProps = require('react-click-keypress')
<div role='button' tabIndex='0' {...clickKeyProps(handleClick)} />
API
clickKeyProps(handler)
-> props
handler
An event handler. Takes a click event if click, key event if space/enter.
Returns a props object to spread onto a React element.
License
MIT © Andrew Joslin