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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    6
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i react-click-keypress

Weekly Downloads

6

Version

1.1.0

License

MIT

Unpacked Size

3.44 kB

Total Files

5

Last publish

Collaborators

  • andytjoslin