Add a textarea.

This commit is contained in:
Tom Alexander 2024-01-12 21:42:12 -05:00
parent 8fa6eecae0
commit b6f74c9a6e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 13 additions and 12 deletions

View File

@ -1,23 +1,13 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Editor from './Editor';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
<Editor />
</header>
</div>
);

11
src/Editor.tsx Normal file
View File

@ -0,0 +1,11 @@
function Editor() {
function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
console.log(event.target.value);
}
return (
<textarea onChange={handleChange}></textarea>
);
}
export default Editor;