How can I make a TextMeshPro prefab visible when instantiating?

Hello,

Simple question, How can I make a TextMeshPro prefab visible when instantiating?
I am doing a quick exercise to understand how Instantiate works with UI elements, in this case a TextMeshPro. I have created a Prefab (“one”) of my TextMeshPro and attached it to the “instantiate” script, when I press play the field where I attached my Prefab shows “none” which makes the prefab not visible. Please find the images below that exemplifies this:

Before pressing play:
202634-1.jpg

While play mode:
202635-2.jpg

My script looks like this:

public class Instantiate : MonoBehaviour
{
    public TextMeshProUGUI text;
    [SerializeField] private Transform spawnPoint;


    // Start is called before the first frame update
    void Start()
    {
       Instantiate(text, spawnPoint.position, spawnPoint.rotation);
       text = GetComponent<TextMeshProUGUI>();

    }


}

Thank you!

You instantiate GameObjects, not components (scripts)
You need a Prefab of a gameobject with a TextmeshPro component attached to create a clone.

Or create an empty gameobject and use AddComponent() on it.