Keep an input's value in state. Show it with value={name} and update it with onChange (a controlled component)
value and onChange go together. Without onChange, you can't type anything
For checkboxes, use checked instead of value, and e.target.checked instead of e.target.value
Try it
import{useState}from"react"exportdefaultfunctionApp(){const[name,setName] = useState("")const[agreed,setAgreed] = useState(false)return(<divstyle={{padding:16,display:"grid",gap:12}}><inputvalue={name}onChange={(e)=>setName(e.target.value)}placeholder="Name"/><label><inputtype="checkbox"checked={agreed}onChange={(e)=>setAgreed(e.target.checked)}/>
I agree to the terms of use
</label><buttondisabled={!name || !agreed}>Submit</button><p>Typing: {name}</p></div>)}