Check out example codes for "how to call something once in update". It will help you in understanding the concepts better.

Code Example 1

bool isDone = false;

void Update() {
    if (!isDone) {
        // put your code that runs once here
        isDone = true;
    }
}

Learn ReactJs, React Native from akashmittal.com