I am building a custom legend and I need to get the renderers for MapImageLayer sublayers. I see renderer under layer.allSublayers._items[1].renderer, but for some reason it is null. See the console for this codepen to see what I mean.
So how can I get the renderer for each sublayer show I can show the correct symbol in my legend?