Setting the alpha of an instantiated Canvas

I’m instantiating a canvas from Resources, which has a Canvas Group. When this is created, I want to immediately set the alpha to 0, and set it to 1 later. I’m having trouble accessing the component after instantiating through. here’s what I’ve got in my Start(){}

var DialogueCanvas : Canvas = Instantiate(Resources.Load("DialogueCanvas", Canvas));
DialogueCanvas.GetComponent("CanvasGroup").alpha = 0.5;

But this doesn’t work. Am I accessing the clone incorrectly? Do I need to put the component into a separate variable? I can’t find good documentation for this.

Don’t use quotes when using GetComponent, since that makes it cast to Component, instead of the correct type. Also it’s slower.