0

I am getting this strange compile error when I try to import the Menu and MenuItem components.

Failed to compile
C:/XXXXXXX/ClientApp/node_modules/@progress/kendo-react-layout/dist/npm/panelbar/PanelBar.d.ts
TypeScript error in C:/XXXXXXX/ClientApp/node_modules/@progress/kendo-react-layout/dist/npm/panelbar/PanelBar.d.ts(70,23):
Generic type 'ReactElement<P>' requires 1 type argument(s).  TS2314

    68 |      * @hidden
    69 |      */
  > 70 |     onSelect: (child: React.ReactElement<PanelBarItemProps, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>, expanded: string[]) => void;
       |                       ^
    71 |     /**
    72 |      * @hidden
    73 |      */

Commenting out the kendo-react-layout import removes the error. The version of kendo I am using is, and am using the default theme.

"@progress/kendo-data-query": "^1.5.2",
"@progress/kendo-drawing": "^1.6.0",
"@progress/kendo-react-dateinputs": "^3.4.1",
"@progress/kendo-react-dialogs": "^3.4.1",
"@progress/kendo-react-dropdowns": "^3.4.1",
"@progress/kendo-react-grid": "^3.4.1",
"@progress/kendo-react-inputs": "^3.4.1",
"@progress/kendo-react-intl": "^3.4.1",
"@progress/kendo-react-layout": "^3.4.1",
"@progress/kendo-theme-default": "^4.3.3",
import * as React from 'react';
import { Menu, MenuItem } from '@progress/kendo-react-layout';
export default () => {
    return (
        <header>
            <Menu>
                <MenuItem text="Item1" />
                <MenuItem text="Item2" />
                <MenuItem text="Item3" />
            </Menu>
        </header>
    );
}
Padhraic
  • 5,112
  • 4
  • 30
  • 39

1 Answers1

0

Upgrading the typescript version and the @types/react version solved the problem for me.

"typescript": "3.2.2" => "3.4.5"

"@types/react": "16.7.1" => "16.9.6"

Padhraic
  • 5,112
  • 4
  • 30
  • 39