title: How to passing refs to component in React
body: <p>I have a data like this:</p>
  <pre><code>constructor(props) {
      this.a = React.createRef();
      this.b = React.createRef();
      this.c = React.createRef();
  }
  
  setValue = (data = {}) =&gt; {
      const {a='', b='', c=''} = data.constructor === ({}).constructor ? data : {};
      this.a.current.setValue(a, data =&gt; {
        this.b.current.setValue(data.b, data =&gt; {
           this.c.current.setValue(data.c);
  }
  }
  }
  }
  </code></pre>
  <p>How could I passing that to my customized Component like this:</p>
  <pre><code>&lt;CusComponent ref={this.a}&gt;
  </code></pre>
  <p>Here is the function to get value in CusComponent:</p>
  <pre><code> value = function (a,b,c) {
      if (arguments.length) {
      if (a) {
        this.setState({a}, () =&gt; {
           this.value_a.value(a);
           if (b) {
             this.setState({b}, () =&gt; {
               this.value_b.value(b);
               if (c) {
                 this.setState({c}, () =&gt; {
                   this.value_c.value(c);
      }
      }
      })
  
  }
  }
  }
  </code></pre>
  <p>Thanks a lot!</p>