We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c62cf6f commit 37566c5Copy full SHA for 37566c5
src/useKeyboard.ts
@@ -50,18 +50,7 @@ export function useKeyboard() {
50
]
51
52
return () => {
53
- if (Keyboard.removeListener) {
54
- // React Native < 0.65
55
- Keyboard.removeListener('keyboardWillShow', handleKeyboardWillShow)
56
- Keyboard.removeListener('keyboardDidShow', handleKeyboardDidShow)
57
- Keyboard.removeListener('keyboardWillHide', handleKeyboardWillHide)
58
- Keyboard.removeListener('keyboardDidHide', handleKeyboardDidHide)
59
- } else {
60
- // React Native >= 0.65
61
- for (const subscription of subscriptions) {
62
- subscription.remove()
63
- }
64
+ subscriptions.forEach((subscription) => subscription.remove())
65
}
66
}, [])
67
return {
0 commit comments