Skip to content

Typescript error in antd theme #4525

@v1ack

Description

@v1ack

Prerequisites

What theme are you using?

antd

Version

5.24.7

Current Behavior

antd 5.24 error

node_modules/@rjsf/antd/src/templates/IconButton/index.tsx:45:6 - error TS2322: Type '{ block: true; iconType: string; icon: Element; name?: string | undefined; id?: string | undefined; children?: ReactNode; form?: string | undefined; slot?: string | undefined; ... 270 more ...; registry: Registry<...>; }' is not assignable to type 'Omit<ButtonProps, "onClick">'.
  Types of property 'color' are incompatible.
    Type 'string | undefined' is not assignable to type '"blue" | "purple" | "cyan" | "green" | "magenta" | "pink" | "red" | "orange" | "yellow" | "volcano" | "geekblue" | "lime" | "gold" | "default" | "danger" | "primary" | undefined'.
      Type 'string' is not assignable to type '"blue" | "purple" | "cyan" | "green" | "magenta" | "pink" | "red" | "orange" | "yellow" | "volcano" | "geekblue" | "lime" | "gold" | "default" | "danger" | "primary" | undefined'.

45     <IconButton
        ~~~~~~~~~~

antd 5.22 error

node_modules/@rjsf/antd/src/templates/IconButton/index.tsx:45:10 - error TS2322: Type '{ block: true; iconType: string; icon: Element; name?: string | undefined; id?: string | undefined; children?: ReactNode; form?: string | undefined; slot?: string | undefined; ... 270 more ...; registry: Registry<...>; }' is not assignable to type 'Omit<ButtonProps, "onClick">'.
  Types of property 'color' are incompatible.
    Type 'string | undefined' is not assignable to type '"default" | "danger" | "primary" | undefined'.
      Type 'string' is not assignable to type '"default" | "danger" | "primary" | undefined'.

45         <IconButton
            ~~~~~~~~~~

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS: macos 15
- Node: 22.9.0
- npm: 10.8.3
- typescript: 5.8.2
- antd: 5.24.3

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions