diffs

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

Install
npx skills add 'https://github.com/pierrecomputer/pierre/tree/main/skills/diffs'
Download bundle ↓
main · 1831817Scanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

React API

This reference lists the React-specific exports from @pierre/diffs/react. The entry also re-exports every type in Shared types.

Components and hooks

ExportKindPurpose
FileComponentRenders one code file.
FileDiffComponentRenders pre-parsed diff metadata.
MultiFileDiffComponentParses and renders an old and new file pair.
PatchDiffComponentParses and renders one unified patch string.
UnresolvedFileComponentRenders and resolves merge conflicts in one file.
CodeViewComponentRenders a virtualized list of files and diffs.
VirtualizerComponentProvides simple viewport virtualization.
useVirtualizerHookGets the nearest simple Virtualizer instance.
EditProviderComponentSupplies an editor factory.
useCreateEditorHookGets the nearest editor factory.
WorkerPoolContextProviderComponentCreates and supplies a worker pool.
useWorkerPoolHookGets the nearest worker pool.
useFileInstanceHookCreates and manages a vanilla File instance.
useFileDiffInstanceHookCreates and manages a vanilla FileDiff instance.
useStableCallbackHookReturns a stable callback that reads the latest function.

Component and provider types

ExportPurpose
FilePropsDefines props for File.
FileOptionsDefines vanilla file options and the React options prop.
FileDiffPropsDefines props for FileDiff.
MultiFileDiffPropsDefines props for MultiFileDiff.
PatchDiffPropsDefines props for PatchDiff.
UnresolvedFilePropsDefines props for UnresolvedFile.
UnresolvedFileReactOptionsDefines merge-conflict options for React.
DiffBasePropsReactDefines props shared by React diff components.
CodeViewPropsDefines controlled or uncontrolled CodeView props.
ControlledCodeViewPropsDefines CodeView props with items.
UncontrolledCodeViewPropsDefines CodeView props with initialItems.
CodeViewReactOptionsDefines the React-safe CodeView option set.
CodeViewHandleDefines imperative list, selection, scroll, and editor controls.
EditorFactoryRe-exports the editor factory type from @pierre/diffs/edit.
EditProviderPropsDefines the type-aware EditProvider factory prop.
MergeConflictActionsTypeOptionSelects no actions, default actions, or a custom action renderer.
RenderMergeConflictActionContextSupplies conflict resolution to a custom action renderer.
RenderMergeConflictActionsDefines a custom conflict action renderer.
WorkerInitializationRenderOptionsDefines initial worker languages and render options.
WorkerPoolOptionsDefines the worker factory, pool size, and cache size.

Contexts and render helpers

ExportKindPurpose
EditContextContextHolds the editor factory.
WorkerPoolContextContextHolds the worker pool.
VirtualizerContextContextHolds the simple virtualizer.
GutterUtilitySlotStylesValueSupplies style keys for gutter utility slots.
MergeConflictSlotStylesValueSupplies style keys for merge conflict slots.
noopRenderFunctionReturns no React output for an optional render slot.
renderDiffChildrenFunctionBuilds React portals for diff slots.
renderFileChildrenFunctionBuilds React portals for file slots.
templateRenderFunctionRenders React content through a managed template slot.
Referenced from SKILL.md