Skip to content
Snippets Groups Projects

implement custom schema field

Merged Philipp S. Sommer requested to merge custom-schema-field into main

this MR implements a custom SchemaField that overwrites the default one (see https://rjsf-team.github.io/react-jsonschema-form/docs/advanced-customization/custom-widgets-fields#custom-schemafield). The reason why we want to do this is because we may want to add a custom uiSchema from within the JSONschema

const {
  fields: { SchemaField },
} = getDefaultRegistry();

const CustomSchemaField = (props: FieldProps) => {
  if (props.schema.uiSchema) {
    const uiSchema = {
      ...(props.uiSchema ? props.uiSchema : {}),
      ...props.schema.uiSchema,
    };
    return <SchemaField {...props} uiSchema={uiSchema} />;
  }
  return <SchemaField {...props} />;
};

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading