The Great Unjanking of the Sheets (#9973)

This commit is contained in:
Samuel Newman
2026-03-09 22:53:32 +02:00
committed by GitHub
parent 18d7e775f6
commit aa897f55a0
27 changed files with 318 additions and 196 deletions
+13 -6
View File
@@ -1,12 +1,19 @@
import React from 'react'
import {Keyboard} from 'react-native'
import {useEffect} from 'react'
import {
Keyboard,
type KeyboardEventListener,
type KeyboardEventName,
} from 'react-native'
export function useOnKeyboardDidShow(cb: () => unknown) {
React.useEffect(() => {
const subscription = Keyboard.addListener('keyboardDidShow', cb)
export function useOnKeyboard(
eventName: KeyboardEventName,
cb: KeyboardEventListener,
) {
useEffect(() => {
const subscription = Keyboard.addListener(eventName, cb)
return () => {
subscription.remove()
}
}, [cb])
}, [eventName, cb])
}