* 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
12 lines
285 B
TypeScript
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])
|
|
}
|