NASA-PDS / wds-react

PDS Web Design System package for React
MIT License
0 stars 0 forks source link

Type definition error when building portal frontend application. #43

Closed anilnatha closed 1 month ago

anilnatha commented 1 month ago

💡 Description

When building our portal code, it is throwing a build error related to the type of the navitems property of our Header:

src/components/Header/Header.tsx:88:9 - error TS2322: Type 'NavItems[]' is not assignable to type '[{ id: string; label: string; href: string; items?: [{ id: string; label: string; href: string; }] | undefined; }]'.
  Target requires 1 element(s) but source may have fewer.

88         navItems={navItems}
           ~~~~~~~~

  ../../../wds-react/dist/esm/components/Header/Header.d.ts:2:5
    2     navItems: [
          ~~~~~~~~
    The expected type comes from property 'navItems' which is declared here on type 'IntrinsicAttributes & HeaderProps'

⚔️ Parent Epic / Related Tickets

No response

anilnatha commented 1 month ago

Fixed via PR #44