kendo-react
kendo-react copied to clipboard
ExcelExport triggers error when used conditionally
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
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.