Check out example codes for "how to change material in script unity". It will help you in understanding the concepts better.
Code Example 1
public Material Material1;
//in the editor this is what you would set as the object you wan't to change
public Renderer Object;
void Start()
{
Object.material = Material1;
}
Learn ReactJs, React Native from akashmittal.com