bsky-app/src/components/hooks/useOnKeyboard.ts
Hailey ad3dd9f6dc
Fix problems with BottomSheet and the report dialog (#3297)
* use @discord/bottom-sheet

* add @types/invariant

* some progress on keyboard dialog

* rework

rework

add a comment

use discord bottom sheet

* remove `@gorhom/bottom-sheet`

* remove android specific code

* organize imports
2024-03-20 17:26:38 -07:00

12 lines
285 B
TypeScript

import React from 'react'
import {Keyboard} from 'react-native'
export function useOnKeyboardDidShow(cb: () => unknown) {
React.useEffect(() => {
const subscription = Keyboard.addListener('keyboardDidShow', cb)
return () => {
subscription.remove()
}
}, [cb])
}