Rotation with mouse instantly resets

I’m trying to get my player to rotate based on mouse movement (top down perspective, 3d game), but this ends up creating a really jerky motion that instantly resets my rotation back to zero. Not sure why this is happening - any help would be very appreciated!

void NewTurning()
{
    float rot = Input.GetAxis("Mouse X") * rotSpeed * Time.deltaTime;

    Quaternion newRotation = Quaternion.Euler(0, rot, 0);

    transform.localRotation = newRotation;
}

You are setting the rotation always to pretty much the exact same value every time this code runs. I think you want to add to the existing rotation which would look like this:

Quaternion newRotation = transform.localRotation * Quaternion.Euler(0,rot,0);

That will add to your existing rotation