use-keydown-on-textarea

use-keydown-on-textarea hook

Get Started

⚠️

Docs is under construction.

Description

install

To create a Nextra Docs site manually, you have to install Next.js, React, Nextra, and Nextra Docs Theme. In your project directory, run the following command to install the dependencies:

  npm install -d @melmerrouni/custom-hooks

Example

You just need to import useKeydownOnTextArea from @melmerrouni/custom-hooks:

demo.tsx
 
import {useKeydownOnTextArea} from '@melmerrouni/custom-hooks';
 
const Target = () => {
  const {code, ref} = useKeydownOnTextArea();    
    return (
        <textarea ref={ref} style={style} />
    )
};

Demo

Last updated on April 6, 2023