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

Code Example 1

Cursor.lockState = CursorLockMode.locked; 
 Cursor.visible = false;

Learn ReactJs, React Native from akashmittal.com