Controlled vs. Uncontrolled Components

JSX Prop Elements Controlled? Requires onChange Purpose
value input, select Yes Yes Bind live value to React state
defaultValue input, select No No Set initial value only
checked checkbox, radio Yes Yes Bind live boolean to state
defaultChecked checkbox, radio No No Set initial checked state

Controlled components

Value is source‑of‑truth in React state; UI updates via onChange.

const [text, setText] = useState("")
<input value={text} onChange={e => setText(e.target.value)} />

Uncontrolled components

React does not track updates; only the initial value is set.

<input type="text" defaultValue="Hello" />
<input type="checkbox" defaultChecked />

Server Actions

Core ideas

// Implicit trigger when passed to a form or button
<form action={serverAction}>
<button formAction={serverAction}>

<aside>

React Flight diff: the minimal data needed to patch Server Component output on the client.

</aside>

Property call

Using <form action={serverAction}> or <button formAction={serverAction}>: