react-click-keypress

1.1.0 • Public • Published

react-click-keypress Build Status

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

Package Sidebar

Install

npm i react-click-keypress

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

3.44 kB

Total Files

5

Last publish

Collaborators

  • andytjoslin