Check out example codes for "unity hide mouse first person". It will help you in understanding the concepts better.

Code Example 1

void Start()
    {//Makes it invisable
        Cursor.visible = false;
  //Locks the mouse in place
        Cursor.lockState = CursorLockMode.Locked;
  // In unity press esc to unlock the mouse and unhide it
  
    }

Learn ReactJs, React Native from akashmittal.com