Approach 2 Controlled Textarea
Controlled textarea provides the feature of managing the value inside the textarea through state. That means, you can explicitly update the value of the textarea on each user input.
Syntax:
function MyForm() {
const [value, setValue] = useState('');
const handleChange = (event) => {
setValue(event.target.value);
};
return (
<Textarea value={value}
onChange={handleChange}
placeholder="Enter your text" />
);
}
Chakra UI Form Textarea
Chakra UI is a react library to create a website’s UI components. Among the provided components, there is a component called `Textarea` which is used to take multiple line text inputs.