Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexmngn/react-native-keyboard-listener
KeyboardListener component for React-Native
https://github.com/alexmngn/react-native-keyboard-listener
Last synced: 16 days ago
JSON representation
KeyboardListener component for React-Native
- Host: GitHub
- URL: https://github.com/alexmngn/react-native-keyboard-listener
- Owner: alexmngn
- Created: 2016-11-12T09:26:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-19T13:47:04.000Z (over 3 years ago)
- Last Synced: 2024-08-09T08:34:30.385Z (5 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 22
- Watchers: 1
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-keyboard-listener
This component is a shortcut to listen to the keyboard when the component mounts.
Should work for React-Native 0.27+.
## Installation
```
npm install --save react-native-keyboard-listener
```## Usage
Import the component into the file you want to use it:
```js
import KeyboardListener from 'react-native-keyboard-listener';
```Use the component directly in your code. The component won't render anything
```jsx
{ this.setState({ keyboardOpen: true }); }}
onWillHide={() => { this.setState({ keyboardOpen: false }); }}
/>```
## Methods
- `onWillShow()`
- `onWillHide()`
- `onDidShow()`
- `onDidHide()`
- `onWillChangeFrame()`
- `onDidChangeFrame()`## Licence
MIT