italia / design-react-kit

Il toolkit React conforme alle linee guida di design per i siti internet e i servizi digitali della PA.
https://italia.github.io/design-react-kit/
BSD 3-Clause "New" or "Revised" License
156 stars 81 forks source link

[BUG] Typescript compilation error on Accordion component #1034

Closed roffus closed 6 months ago

roffus commented 6 months ago

I'm using react typescript and after updating the library to version 5.0.0 a compilation problem arose with the Accordion component.

The error is the following: TS2559: Type { children: Element; } has no properties in common with type IntrinsicAttributes & AccordionProps and appear on <Accordion>, <AccordionItem>, <AccordionHeader>

e.g.

              <Accordion>
                <AccordionItem>
                  <AccordionHeader>Header</AccordionHeader>
                </AccordionItem>
              </Accordion>

compilerOptions

{
  "compilerOptions": {
    "target": "ESNext",
    "useDefineForClassFields": true,
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "skipLibCheck": true,

    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
  },
  "include": ["src"],
}
Virtute90 commented 6 months ago

I have entered a PR for the resolution of this problem