I suppose that CustomComponent
is a widget? Then you're doing some stuff wrong. The thing you do in your constructor
(I suppose that's to populate your widget properties?) is not even necessary since that's already there by default when you use dijit/_WidgetBase
.
Same with your property domNode
, it's also there already by default if you use dijit/_WidgetBase
.
My guess is that by overriding the constructor to act like this, you're actually doing some steps that the WidgetBase should do and thus messing up the private scope of the properties.
An example widget:
var CustomComponent = declare("my/CustomComponent", [WidgetBase], {
grid: null,
data: [],
buttons: {}
});
This code does exactly the same as your widget and is a lot shorter.
An example JSFiddle that has instance scoped properties (as you can see in the console log).