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
Available Hooks
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 - see the LICENSE file for details.
Author : Mani Kant Sharma