Skip to content

ajoslin/react-click-keypress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Spread a click & enter/space key event handler onto an element

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •