Skip to content

Commit

Permalink
change deviceEventEmitter to Keyboard for rn 0.27.2 (#34)
Browse files Browse the repository at this point in the history
* change deviceEventEmitter to Keyboard for rn 0.27.2

* update readme
  • Loading branch information
Libin Lu authored and alvaromb committed Jun 17, 2016
1 parent ec893f7 commit eb0c935
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ A ScrollView component that handles keyboard appearance and automatically scroll
</p>

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

## Installation
Installation can be done through ``npm``:
Expand Down
6 changes: 3 additions & 3 deletions lib/KeyboardAwareMixin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { PropTypes } from 'react'
import ReactNative, { TextInput, DeviceEventEmitter } from 'react-native'
import ReactNative, { TextInput, Keyboard } from 'react-native'
import TimerMixin from 'react-timer-mixin'

const _KAM_DEFAULT_TAB_BAR_HEIGHT = 49
Expand Down Expand Up @@ -73,8 +73,8 @@ const KeyboardAwareMixin = {

componentDidMount: function () {
// Keyboard events
this.keyboardWillShowEvent = DeviceEventEmitter.addListener('keyboardWillShow', this.updateKeyboardSpace)
this.keyboardWillHideEvent = DeviceEventEmitter.addListener('keyboardWillHide', this.resetKeyboardSpace)
this.keyboardWillShowEvent = Keyboard.addListener('keyboardWillShow', this.updateKeyboardSpace)
this.keyboardWillHideEvent = Keyboard.addListener('keyboardWillHide', this.resetKeyboardSpace)
},

componentWillUnmount: function () {
Expand Down

0 comments on commit eb0c935

Please sign in to comment.