Check out example codes for "unity 3d mouse look script". It will help you in understanding the concepts better.

Code Example 1

public float lookSpeed = 3;
private Vector2 rotation = Vector2.zero;
public void Look() // Look rotation (UP down is Camera) (Left right is Transform rotation)
    {
        rotation.y += Input.GetAxis("Mouse X");
        rotation.x += -Input.GetAxis("Mouse Y");
        Camera.main.transform.localRotation = Quaternion.Euler(rotation.x * lookSpeed, rotation.y * lookSpeed, 0);
    }

Code Example 2

unity mouseLook

Learn ReactJs, React Native from akashmittal.com