React Textarea

React Textarea

In standard HTML, the <textarea> element defines its contained text by its inner children. In React, a <textarea> instead uses a value attribute, which makes it function uniformly and identically to a standard single-line text input.

Using Textarea

import { useState } from 'react';

function EssayForm() { const [text, setText] = useState("Write your essay here."); return <textarea value={text} onChange={(e) => setText(e.target.value)} />; }