Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 348 Bytes
import * as React from 'react'
function useKeydownLister(
cb: (event: KeyboardEvent) => void,
currentDirection: any,
currentPos: any
) {
React.useEffect(() => {
document.addEventListener('keydown', cb)
return () => document.removeEventListener('keydown', cb)
}, [currentDirection, currentPos])
export default useKeydownLister
You can’t perform that action at this time.