List.Add component as Renderer, can't access?

Tried to do:

thisList.Add(aGameObject.GetComponentsInChildren(Renderer);

but Unity says List is not compatible because it reads it as component, so I needed:

thisList.Add(aGameObject.GetComponentsInChildren(Renderer) as Renderer);

and now, when I try to extend that later in code, like:

for(var kowabunga in thisList){
kowabunga.enabled = true;
}

I get null reference errors. Not sure how to get around this issue.

GetComponentsInChildren returns a Component - that’s an array of components. You can’t cast an array to a single Renderer, as you’re trying to do, which means the cast fails, ans because it’s an “as” cast, returns null. Essentially this means that you’re adding “null” to the list every time.