1 min readJul 19, 2018
I love classes for reusing components, but I’ve yet to successfully create complex elements with multiple children using class constructors. The (clearly flawed) method I’ve been using is to create those children within the constructor like normal elements:
childElement = new Layer
…
parent: @
But later in the code, I cannot reference childElement using childrenWithName, selectChild, or children[i]. I imagine this is some kind of scope issue. Any ideas of a better way to approach this?