kendo-react icon indicating copy to clipboard operation
kendo-react copied to clipboard

Type problems in itemRender in ComboBox adn DropDownList with React 18

Open marcinkowal2015 opened this issue 3 years ago • 2 comments

I'm submitting a...

  • Bug report

Current behavior

In ComboBox itemRender functions are not compiling after upgrade to React 18

image

Similar can be observed in DropDownList

image

Expected behavior

Code compiles without error

System:

  • TypeScript version: 4.7.4<!-- run tsc --version -->
  • Node version: v16.14.2 <!-- run "node --version" and "npm --version"-->
  • Platform: Windows

marcinkowal2015 avatar Jun 29 '22 12:06 marcinkowal2015

I was able to bypass this problem by using Fragment to wrap li.props.children

image

Following this blog post https://bobbyhadz.com/blog/react-this-tags-children-prop-expects-single-child

I am not however 100% sure root cause of this problem - is this something which needs adjustment on kendo-react side? Example from documentation does not require such construct https://codesandbox.io/s/0uofn1?file=/app/main.tsx

marcinkowal2015 avatar Jul 04 '22 09:07 marcinkowal2015

@marcinkowal2015 - I am not sure at the moment what we can adjust.

Thank you for sharing this solution.

nstoychev avatar Jul 04 '22 10:07 nstoychev