mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 13:09:03 +08:00
17 lines
377 B
JavaScript
17 lines
377 B
JavaScript
import { useState } from "react"
|
|
import Hello from "./Hello.jsx"
|
|
|
|
export default function App(){
|
|
const [username, setUsername] = useState("John");
|
|
|
|
function handleChange(event){
|
|
setUsername(event.target.value)
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<input value={username} onChange={handleChange} />
|
|
<Hello name={username} />
|
|
</>
|
|
)
|
|
} |