Skip to main content

How to create key event

create your app

import { useKey } from 'reev/gesture/key/react'

export const App = () => {
const { ref } = useKey(console.log)
return <span ref={ref} style={style} />
}

with Key component

You can use shorthands Key component

import { Key } from 'reev/gesture/key/react'

export const App2 = () => {
return <Key key={console.log}>{({ ref }) => <span ref={ref} style={style} />}</Key>
}