Skip to content

Type error on ArrayField component #4270

@arepsz

Description

@arepsz

Prerequisites

What theme are you using?

core

Version

5.20.0

Current Behavior

I tried to add a simple form to my React app. I have some custom widgets and templates imported into it. This is the error I get while trying to build the project:
image

This is how I export my templates:

export const jsonFormTemplates: FormProps['templates'] = {
  TitleFieldTemplate: CustomTitleTemplate,
  FieldTemplate: CustomFieldTemplate,
  DescriptionFieldTemplate: CustomDescriptionTemplate,
  ObjectFieldTemplate: CustomObjectFieldTemplate,
  FieldErrorTemplate: CustomFieldErrorTemplate,
}

And my widgets:

export const JsonFormWidgets: RegistryWidgetsType = {
  TextWidget: CustomTextWidget,
  SelectWidget: CustomSelectWidget,
  CheckboxWidget: CustomCheckboxWidget,
}

These exported variables are simply given to the widgets and templates props of the Form component.
None of the widgets or templates use the @rjsf/core component, and when I remove these imports the project builds. So I need some help to understand what went wrong. I can upload everything to CodeSandbox if it's necessary.

Expected Behavior

The project should build without any issues.

Steps To Reproduce

  1. Create simple NextJS app with Shadcn UI componetnts
  2. Add RJSF packages and create widgets, templates
  3. Import templates and widgets, use them in a Form
  4. Try to build the project

Environment

- OS: MacOS 14.4.1 (23E224)
- Node: v22.4.1.
- npm: 10.8.1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageInitial label given, to be assigned correct labels and assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions