I have a component that I defined the kids for in JSON. One of the kids is a Panel that I want to dynamically inject other components into. I noticed that as I create multiple instances of this component, I see the dynamic components from all instances in each component.
When I looked into the code, it seems that the properties are being copied shallowly per instance. This would mean that every instance of my component shares the same children. Is this correct? The only way to avoid this seems to be to define a $new function, which would turn the class into a factory, but I want to use existing zebra components that are not factories. I also want to define properties in JSON per each child. I think the end behavior would basically be to define a template in JSON that is evaluated per instance vs defining concrete instances of children that are shared across all instances of the component. Do you have any recommendation about how to approach this issue?

Please login or Register to Submit Answer