forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {useEffect} from 'react'
2import {
3 Keyboard,
4 type KeyboardEventListener,
5 type KeyboardEventName,
6} from 'react-native'
7
8export function useOnKeyboard(
9 eventName: KeyboardEventName,
10 cb: KeyboardEventListener,
11) {
12 useEffect(() => {
13 const subscription = Keyboard.addListener(eventName, cb)
14
15 return () => {
16 subscription.remove()
17 }
18 }, [eventName, cb])
19}