From eea81c2733f9f09cda7ddff3402cea954b2f0dbe Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Sat, 18 Oct 2025 15:39:44 +0200 Subject: [PATCH] docs: remove `error` mentions in signal forms docs `error` no longer exists and is called `validate` (cherry picked from commit 800b01f5a1cabdb7684f865c2cf6893494f5ac2f) --- packages/forms/signals/src/api/structure.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/forms/signals/src/api/structure.ts b/packages/forms/signals/src/api/structure.ts index 2a3134ac365..3fdb40ae788 100644 --- a/packages/forms/signals/src/api/structure.ts +++ b/packages/forms/signals/src/api/structure.ts @@ -155,7 +155,7 @@ export function form( * ``` * const nameForm = form(signal({first: '', last: ''}), (name) => { * required(name.first); - * error(name.last, ({value}) => !/^[a-z]+$/i.test(value()), 'Alphabet characters only'); + * validate(name.last, ({value}) => !/^[a-z]+$/i.test(value()) ? customError({kind: 'alphabet-only'}) : undefined); * }); * nameForm().valid(); // false * nameForm().value.set({first: 'John', last: 'Doe'}); @@ -205,22 +205,6 @@ export function form(...args: any[]): FieldTree { * }); * ``` * - * When binding logic to the array items, the `FieldTree` for the array item is passed as an - * additional argument. This can be used to reference other properties on the item. - * - * @example - * ``` - * const namesForm = form(signal([{first: '', last: ''}]), (names) => { - * applyEach(names, (name) => { - * error( - * name.last, - * (value, nameField) => value === nameField.first().value(), - * 'Last name must be different than first name', - * ); - * }); - * }); - * ``` - * * @param path The target path for an array field whose items the schema will be applied to. * @param schema A schema for an element of the array, or function that binds logic to an * element of the array.