gameObject.SetActive() or CanvasRenderer.SetAlpha() for visibility

Which one is better for just changing visibility? Lets assume that the gameobject has no scripts on it other than an Image or Text script

TY!

I would use SetActive, mainly because some UI elements can block raycasts.