Without a value prop the input is not controlled.
Acceptance criteria
- 1.The field should show Ada after filling.
Without a value prop the input is not controlled.
function App() { const [text, setText] = React.useState("") return ( <div> <input id="field" onChange={(e) => setText(e.target.value)} /> <button id="fill" onClick={() => setText("Ada")}>fill</button> </div> ) } const root = ReactDOM.createRoot(document.getElementById("root")) root.render(<App />)
Output ready when you are
Press Run to render your code, or Submit to validate your solution.