Check out example codes for "how to get the name of the button pressed in unity". It will help you in understanding the concepts better.
Code Example 1
//this is Unity pared with C#
using UnityEngine.EventSystems;
public class Class : Monobehaviour
{
//Call this function when the button is pressed
public void ButtonClicked()
{
string name = EventSystem.current.currentSelectedGameObject.name;
}
}
Learn ReactJs, React Native from akashmittal.com