Skip to content

Diff

Diff(__namedParameters): ReactElement

Defined in: react/components/data/diff.tsx:39

A syntax-highlighted code diff — the view a coding agent shows when it proposes a file edit. Computes a line diff between oldText and newText, tints added/removed lines, and collapses long unchanged runs. A clickable header toggle switches between unified and split layout.

Works controlled (pass view + onViewChange) or uncontrolled (defaultView).

<Diff language="ts" oldText={before} newText={after} />

DiffProps

ReactElement