Is there a more efficient way to utilize a nested "this" in a Stencil.js component?
Currently, I find myself following this approach:
render() {
let thisNested = this;
return <Host>
{this.images ?
this.imagesArray.map(function (el) {
return <img
// @ts-ignore
src={thisNested.imageSize ? thisNested.imageSize : el.url}/>
}) : <slot/>}
</div>
</Host>;
}
However, I keep repeating the process of creating a nested this variable as shown above.
Could someone suggest a more elegant solution for achieving what I require?