React Custom Hooks
React Custom Hooks provide an efficient means to encapsulate and share logic among components within React applications.
This package includes useful React custom hooks, such as useKeyboard.
Installation
You can install the package using npm:
npm install react-mkx-toolkit
Or using yarn:
yarn add react-mkx-toolkit
Table of Contents
Browser Support
 |  |  |  |  |  |
---|
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
useKeyboard
import { useKeyboard } from "react-mkx-toolkit";
const MyComponent = () => {
const handleKeyPress = () => {
console.log("The Enter key was pressed!");
};
useKeyboard("Enter", handleKeyPress);
return <>MyComponent</>;
};
export default MyComponent;
License
This project is licensed under the ISC License.
Author : Mani Kant Sharma