Closed lkrugertogetr closed 2 years ago
We've modified the clone
function to now properly clone React.Element
instances with version 4.11.0
of all kendo-react packages.
Please refer to the Changelog for the full list of changes: https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/#be637ab5-74d0-5d30-b4cb-ecf78c7a32f2
I'm submitting a...
Current behavior
props.dataItem
accessed from a custom SchedulerItem is a copy of the inserted data item for some reason, and instead of being an instance of a class it is now an object where getters and methods are lost.Expected behavior
Expect dataItem either to be a reference to an item passed in the data array in the Scheduler component or a correct copy.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/react-rbhpac?file=app/main.tsx Look in the console, expected to log:
Instead it logs:
What is the motivation or use case for changing the behavior?
I have an instance of a utility class Color in the dataItem for rendering the background color, where I want to access a getter for the hexadecimal value of the color and a method used to calculate contrast to decide the color of the text.
Environment
Package versions:
Browser:
System:
Obviously I can just make objects out of my instances, but that seems like unnecessary and avoidable code.