Add a textarea.
This commit is contained in:
parent
8fa6eecae0
commit
b6f74c9a6e
14
src/App.tsx
14
src/App.tsx
@ -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
11
src/Editor.tsx
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user