Migration and deprecations

Deprecated, removed in 1.0

Each still works and is marked @deprecated (or documented as an alias), so editors flag it.

DeprecatedUse insteadSince
onSubmitErroronInvalid (validation errors); onSubmitFailure for errors thrown by onSubmit0.16
useArrayField().itemsfields (marked @deprecated in 0.21)0.16
useArrayField().pushappend (marked @deprecated in 0.21)0.16
useField().idyour own id: useId() in the adapter, or the input inside its <label> (the lib does not make DOM ids)0.20

Breaking changes

0.21

  • An array field's own render wins over fieldMapping.array (before, a mapped array component silently replaced every array's render).
  • render on a mapped field reads the field state (value, errorMessage, …) and gets no onChange / onBlur / ref; to control the input, use an inline field.
  • Form-level readOnly only adds read-only: <Form readOnly={false}> no longer unlocks a field declared readOnly: true.
  • formOptions no longer takes defaultValues (it was ignored): use the defaultValues prop.
  • RootRendererArgs.onError is removed (it was never passed); use onInvalid on <Form>.

0.20

  • useField().id is the field path again, and the idPrefix prop (added in 0.19) is removed: 0.19 generated ids with React's useId, which does not exist before React 18. Associate labels in the adapter: see Accessibility.

0.19

  • ctx.scope (second argument of compute, and of visible / disabled / required functions) is typed Partial<T> | undefined: it is undefined while a row is gone (right after remove(), or with shouldUnregister). Read it as scope?.x.
  • Error messages go through t at display (errorMessage), like labels; fields with a validation error are validated again when t changes, and errors from setError() are kept.

Every release, with all changes: changelog.