Skip to content

SaveAnswer

type SaveAnswer =
| void
| {
error: string;
}
| {
conflict: true | string;
};

What onSave may answer instead of throwing: { error } shows the message and keeps the changes, and { conflict } is a save conflict, as SaveConflictError is, in the host’s words or (with true) the editor’s. For a handler on a server, such as a React Server Action, whose thrown errors don’t reach the page as written.