Skip to content

CollectionEditView

CollectionEditView<TFieldMeta, TCollectionMeta, TSlug>(props): Element

Defined in: packages/react/src/components/views/CollectionEditView.tsx:44

Collection document edit form.

Fetches the document when editing via vexConvexApi.get (TanStack Query + Convex subscription), initialises a useCollectionForm instance with the current field values, and renders an <AppForm> with one input component per field. Submits via vexConvexApi.update. Field inputs connect to the form through AppFormContext — no controller prop needed.

TSlug is inferred from the collection prop. After running vex generate, passing a collection of one slug where another is expected is a type error.

TFieldMeta extends object = { }

TCollectionMeta extends object = { }

TSlug extends string = string

CollectionEditViewProps<TFieldMeta, TCollectionMeta, TSlug>

View props

Element

The edit form, or a not-found message when the document cannot be loaded.

// New document
<CollectionEditView collection={postsCollection} />
// Editing existing document
<CollectionEditView
collection={postsCollection}
documentId="k573abc..."
initialData={serverDoc}
/>