Pattern

Controlled field contract

A parent supplies the value and receives changes through an explicit callback.

Formal Syntax & Structure

react syntaxreact
value: string; onChange: (value: string) => void

Working Example

Example Snippetreact
<TextField value={name} onChange={setName} label="Name" name="name" />
React Reference