title: How to call function from one component to another component with Button
body: <p>I Created a <code>Submit()</code> function in one component with name <code>formSignup.js</code> and I created another component with name <code>buttonSubmit.js</code> that contain Button(onPress) with that button I want to call <code>Submit()</code> function that is in f<code>ormSignup.js</code>. </p>
  
  <p>Reason for creating separate component for Submit button is that, I wrote a lot of code for animation and also I want to re-use that Button in <code>loginComponent.js</code>.  </p>
  
  <p><strong>formSignup.js</strong></p>
  
  <pre><code>submit = () =&gt; {
  ...
  }
  </code></pre>
  
  <p><strong>buttonSubmit.js</strong> </p>
  
  <pre><code>How can i call submit function from  fromSignup.js here
  
    _onPress() {
      if (this.state.isLoading ) return;
  
      this.setState({isLoading: true});
      Animated.timing(this.buttonAnimated, {
        toValue: 1,
        duration: 200,
        easing: Easing.linear,
      }).start();
  
      setTimeout(() =&gt; {
        this._onGrow();
      }, 2000);
  
      setTimeout(() =&gt; {
        Actions.mainScreen();
        this.setState({isLoading: false});
        this.buttonAnimated.setValue(0);
        this.growAnimated.setValue(0);
      }, 2300);
  
    }
  -----
  return(
            &lt;TouchableOpacity
              onPress={this._onPress}
              activeOpacity={1}&gt;
              {this.state.isLoading ? (
                &lt;Image source={spinner} style={styles.image} /&gt;
              ) : (
                &lt;Text style={styles.text}&gt;Go&lt;/Text&gt;
              )}
            &lt;/TouchableOpacity&gt;
  );
  </code></pre>