React native parent child communication and return values
<p>I am a beginner to the react native environment. I want to understand parent child communication in react native. </p>

<ol>
<li><p>Parent will pass a number to a child - As an example parent pass "2" to a child. </p></li>
<li><p>Child will have a processing function which multiple the same number 2 times and return the result back to parent. - As example 2*2 and return </p></li>
<li><p>parent will call child function and see if output if correct and print results on parent container</p></li>
<li><p>if I would have done this in a programming lang like c++ or java. </p>

<p>*</p></li>
</ol>

<blockquote>
<pre><code>parent.number = 2;
  parent.result = child.getResult(parent.number);
  if(parent.result == 4){
      Print "child return correct value";
  }else{
      child return wrong value.
  }
</code></pre>
</blockquote>

<p>*</p>

<p>I have seen couple of react native tutorials online but, still this parent child communication is not clear. </p>

<p>Can someone please code 2 react native js file one for parent and one for a child and show me the communication. </p>

<p>Thanks </p>