Enhance textareas with automatic line numbering and array value handling for better organization and reference.
You can install the package via npm or yarn:
npm install react-auto-indexed
or
yarn add react-auto-indexed
import React from 'react';
import { ReactAutoIndex } from 'react-auto-indexed';
const App = () => {
const handleChange = (value) => {
console.log('Textarea value changed:', value);
};
return (
<div>
<h1>React Auto Indexed Demo</h1>
<ReactAutoIndex
value={['Item 1', 'Item 2', 'Item 3']}
placeholder="Type here..."
onChange={handleChange}
/>
</div>
);
};
export default App;
- type:
array
- type:
string
- type:
function
- type:
string