React 19 · JSX patterns

Create a controlled input

Keep the input's value in state.

<input value={text} onChange={(e) => setText(e.target.value)} />

Official React 19 documentation

More jsx patterns commands

All jsx patterns commands · React 19 cheatsheet

Was this page helpful?