View as Markdown

API reference: @salmonui/editors/inline-edit

InlineEditRenderContextinterface

import type { InlineEditRenderContext } from '@salmonui/editors/inline-edit';
interface InlineEditRenderContext<T> {
    readonly value: T;
    readonly setValue: (value: T) => void;
    readonly inputProps: InlineEditInputProps;
    readonly save: () => void;
    readonly cancel: () => void;
    readonly pending: boolean;
    readonly errors: readonly string[];
}

Argument of the children render prop.

InlineEditRenderContext members (7)
NameSignatureDescription
valuereadonly value: T;

The draft value.

setValuereadonly setValue: (value: T) => void;

Replaces the draft.

inputPropsreadonly inputProps: InlineEditInputProps;

Wiring for a text-like input (value is the draft as a string).

savereadonly save: () => void;
cancelreadonly cancel: () => void;
pendingreadonly pending: boolean;

True while save (or async validation) is pending.

errorsreadonly errors: readonly string[];

Validation messages of the draft (empty when valid).