Skip to content

Commit eb0c935

Browse files
Libin Lualvaromb
authored andcommitted
change deviceEventEmitter to Keyboard for rn 0.27.2 (#34)
* change deviceEventEmitter to Keyboard for rn 0.27.2 * update readme
1 parent ec893f7 commit eb0c935

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ A ScrollView component that handles keyboard appearance and automatically scroll
99
</p>
1010

1111
## Supported versions
12-
Use `react-native>=0.25.0` for `v0.0.7` & up and `v0.0.6` for older RN versions.
12+
`v0.1.2` requires `RN>=0.27.2`
13+
`v0.0.7` requires `react-native>=0.25.0`
14+
use `v0.0.6` for older RN versions.
1315

1416
## Installation
1517
Installation can be done through ``npm``:

lib/KeyboardAwareMixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22

33
import { PropTypes } from 'react'
4-
import ReactNative, { TextInput, DeviceEventEmitter } from 'react-native'
4+
import ReactNative, { TextInput, Keyboard } from 'react-native'
55
import TimerMixin from 'react-timer-mixin'
66

77
const _KAM_DEFAULT_TAB_BAR_HEIGHT = 49
@@ -73,8 +73,8 @@ const KeyboardAwareMixin = {
7373

7474
componentDidMount: function () {
7575
// Keyboard events
76-
this.keyboardWillShowEvent = DeviceEventEmitter.addListener('keyboardWillShow', this.updateKeyboardSpace)
77-
this.keyboardWillHideEvent = DeviceEventEmitter.addListener('keyboardWillHide', this.resetKeyboardSpace)
76+
this.keyboardWillShowEvent = Keyboard.addListener('keyboardWillShow', this.updateKeyboardSpace)
77+
this.keyboardWillHideEvent = Keyboard.addListener('keyboardWillHide', this.resetKeyboardSpace)
7878
},
7979

8080
componentWillUnmount: function () {

0 commit comments

Comments
 (0)