Skip to main content
Version: Current (v7.0.0-beta.3)

constAsDefaults skipOneOf is deprecated

Detect​

  • In your Form props or getDefaultFormState() calls: defaultFormStateBehavior.constAsDefaults set to 'skipOneOf'.

Change​

constAsDefaults: 'skipOneOf' left a constant oneOf empty. With the flag left unset, a list of several constants with no default now starts empty, under anyOf too (see A list of choices with no default starts empty), so 'skipOneOf' is deprecated (#5944).

Remove it, unless the form relies on it leaving out a oneOf of one constant, or the const of a property inside a oneOf option. It still leaves those out for a field with a single primitive type or none, and for a select over object or array constants with a single type or none.

-<Form schema={schema} validator={validator} defaultFormStateBehavior={{ constAsDefaults: 'skipOneOf' }} />
+<Form schema={schema} validator={validator} />

Verify​

  • No defaultFormStateBehavior sets constAsDefaults: 'skipOneOf', or the form needs it for a oneOf of one constant or a const inside a oneOf option.
  • With the setting removed, a constant oneOf of several values with no default still starts empty.

Also read: