Attempt to at move app into app sub dir

This commit is contained in:
Kurt Hutten
2021-05-01 07:32:21 +10:00
parent 9db76458d1
commit 78677a99f8
220 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import { useRef, useEffect } from 'react'
const useKeyPress = (fn) => {
const cb = useRef(fn)
useEffect(() => {
cb.current = fn
}, [fn])
useEffect(() => {
const onUnload = cb.current
window.addEventListener('keydown', onUnload)
return () => window.removeEventListener('keydown', onUnload)
}, [])
}
export default useKeyPress