Check out example codes for "unity3d get component". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine;

public class GetComponentExample : MonoBehaviour
{
    void Start()
    {
        HingeJoint hinge = gameObject.GetComponent(typeof(HingeJoint)) as HingeJoint;        if (hinge != null)
            hinge.useSpring = false;
    }
}

Learn ReactJs, React Native from akashmittal.com