1.0.5 • Published 2 years ago
react-native-keyboard-status v1.0.5
React native keyboard status tracker
INSTALLATION
Install the package using npm
npm install react-native-keyboard-statusor yarn
yarn add react-native-keyboard-statusHook API
useKeyboardStatus()
The useKeyboardStatus hook returns an object with the following property:
isVisible: BooleanA boolean value that indicates whether the keyboard is currently open/visible (
true) or closed/hidden (false).
Usage
Import the useKeyboardStatus hook from the package and use it in your React Native components to track the keyboard status.
Here's a simple example demonstrating how to use the useKeyboardStatus hook:
import React from "react";
import { View, Text } from "react-native";
import useKeyboardStatus from "react-native-keyboard-status";
const MyComponent = () => {
const { isVisible } = useKeyboardStatus();
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>{isVisible ? "Keyboard is open" : "Keyboard is closed"}</Text>
</View>
);
};
export default MyComponent;License
This project is licensed under the ISC License