(e)
| 104 | const [textAreaValue, setTextAreaValue] = React.useState(value.join("\n")); |
| 105 | |
| 106 | const handleChange = (e) => { |
| 107 | const newValue = e.target.value; |
| 108 | setTextAreaValue(newValue); //save in the state the current input value |
| 109 | onChange( |
| 110 | //we send to the backend only the strings that are not empty |
| 111 | newValue |
| 112 | .split("\n") |
| 113 | .map((line) => line.trim()) |
| 114 | .filter((line) => line !== ""), |
| 115 | ); |
| 116 | }; |
| 117 | |
| 118 | return ( |
| 119 | <textarea |