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

ExcelExport triggers error when used conditionally

Open filipKovachev opened this issue 1 year ago • 1 comments

When having a condition based on a prop variable, the ExcelExport outputs the following error:

Cannot read properties of undefined (reading 'children')

This can be reproduced here:

https://stackblitz.com/edit/stackblitz-starters-bcdawe?file=src%2FLicenseList.tsx

The current workaround is to change the condition to render a div:

{isAdmin ? <Button>add</Button> :

}

However, this should not be necessary.

Ticket ID: 1612285

filipKovachev avatar Jun 15 '23 13:06 filipKovachev

Are you sure you need a div here? Looks to me like you just need an empty fragment <> </> because the this is react failing not html. The only reason you would need a div over a fragment would be if it needed to be referenced in the DOM once it's fully rendered.

JDoro avatar Feb 01 '24 17:02 JDoro