Check out example codes for "virtual pet comp 105 code". It will help you in understanding the concepts better.

Code Example 1

function minimalFunction()  // use the actual names you used above
    {
    }

Code Example 2

<body onload="functionName()">

Learn ReactJs, React Native from akashmittal.com