0

I have almost given-up using Menu class of both react component and the react-wrapper.

<Menu onSelect={this.onSelect}>
   <MenuItem text="First item">
       <MenuItem text="Child item"/>
   </MenuItem>
   <MenuItem text="Second item"/>
</Menu>
  1. I am rendering simple Menu with 2 nested menuItems using @kendo-react-layout and getting following error.

Uncaught Error: MenuItemInternal.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. at invariant (invariant.js?4599:42) at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js?d2b3:828) at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js?d2b3:359) at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js?d2b3:255) at Object.mountComponent (ReactReconciler.js?399b:43) at ReactDOMComponent.mountChildren (ReactMultiChild.js?9682:234) at ReactDOMComponent._createInitialChildren (ReactDOMComponent.js?ab8a:701) at ReactDOMComponent.mountComponent (ReactDOMComponent.js?ab8a:520) at Object.mountComponent (ReactReconciler.js?399b:43) at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js?d2b3:368)

  1. Before that, I have been trying to use menu of jQuery wrapper i.e. @kendo-layout-react-wrapper. It was rendering fine, however, not passing the actual selected item in the select event object and it has to fetched thru jQuery. Sometimes li items add no styles/css classes and due to it, difficult to get the selected menuItem using jQuery.

Any suggestions?

Ben Holland
  • 2,309
  • 4
  • 34
  • 50
DevSachin
  • 11
  • 3
  • Update: #2: Looks like dynamic menus are creating this issue. When you have static menu defined, it works fine . – DevSachin Oct 02 '18 at 20:47
  • Select {getmenuItems.call(this)} – DevSachin Oct 02 '18 at 20:54
  • Hi, as for the native Menu I believe that there is something specific in your case because in general this work fine as shown here - https://www.telerik.com/kendo-react-ui/components/layout/menu/items/properties/#toc-text. Could you please provide the full code and explain how you reproduce the problem? – Asen Arizanov Oct 05 '18 at 06:30

0 Answers0