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

A custom ObjectFieldTemplate calls registry.schemaUtils.canExpand

Detect​

  • Your custom ObjectFieldTemplate imports canExpand from @rjsf/utils to decide whether to show its Add button.
  • The type checker reports Module '"@rjsf/utils"' has no exported member 'canExpand'.

Change​

Whether an object naming no additionalProperties takes extra keys is now a form setting, additionalPropertiesWhenAbsent, which travels in the SchemaContext (#2137). Every theme's ObjectFieldTemplate now calls registry.schemaUtils.canExpand(), which passes the form's own SchemaContext, and @rjsf/utils no longer exports canExpand() itself (see @rjsf/utils no longer exports utilities no other RJSF package uses).

Do the same in your template:

-import { canExpand } from '@rjsf/utils';
-{canExpand(schema, uiSchema, formData) && <AddButton onClick={onAddProperty} />}
+{registry.schemaUtils.canExpand(schema, uiSchema, formData) && <AddButton onClick={onAddProperty} />}

Verify​

Also read: