title: Reactjs Scroll with multiple ref
body: <p>I have a doubt with the ref in reactjs. Sorry, it is dumb but I'm still learning. Well, the issues are I'm trying to scroll to react using ref but my question is because I want to use multiple references.</p>
  
  <p>My code is this:</p>
  
  <pre><code>import React, { Component } from "react";
  import './App.css';
  import { Row, Col,Image,ListGroup,Button,Jumbotron,Container} from 'react-bootstrap';
  
  
  
  class App extends Component {
  
    constructor(props) {
      super(props)
      this.myRef = React.createRef()
      this.myRef2 = React.createRef()    // Create a ref object 
  }
  
  
  handleOnClick = (event) =&gt; {
    //.current is verification that your element has rendered
  
    window.scrollTo(2, this.myRef2.current.offsetTop) 
  }
  
  
    render() {
  
  
      return (
      &lt;div className="App"&gt;
               &lt;button onClick={this.handleOnClick}&gt;Click me&lt;/button&gt;
  
        &lt;Row&gt;
          &lt;Col className="menu text-center" lg ={4}&gt;
  
            &lt;div className="picture" &gt;
              &lt;Image src={process.env.PUBLIC_URL + '/Images/picture.jpg'} roundedCircle /&gt;
            &lt;/div&gt;
  
            &lt;h1 className="menu-name"&gt;Carlos Deseda&lt;/h1&gt;
  
            &lt;h4 className="menu-office"&gt;Software Engineer - Web Developer&lt;/h4&gt;
  
            &lt;div&gt;
            &lt;Row&gt;
                &lt;Col lg= {3}&gt;&lt;/Col&gt;
                &lt;Col lg= {6} className="menu-text"&gt;
                  &lt;ListGroup &gt;
                    &lt;ListGroup.Item&gt;ABOUT&lt;/ListGroup.Item&gt;
                    &lt;ListGroup.Item&gt;WORK EXPERIENCE&lt;/ListGroup.Item&gt;
                    &lt;ListGroup.Item&gt;EDUCATION&lt;/ListGroup.Item&gt;
                    &lt;ListGroup.Item&gt;SKILLS &lt;/ListGroup.Item&gt;
                    &lt;ListGroup.Item&gt;CONTACT&lt;/ListGroup.Item&gt;
                  &lt;/ListGroup&gt;
                &lt;/Col&gt;
                &lt;Col lg= {3}&gt;&lt;/Col&gt;
              &lt;/Row&gt;
            &lt;/div&gt;
  
          &lt;/Col&gt;
  
          &lt;Col className="info text-center" lg ={8}&gt;
  
    &lt;div className="ref1" ref={this.myRef}&gt; FirtsOne &lt;/div&gt;
    &lt;div className="ref2" ref={this.myRef2}&gt;SecondOne&lt;/div&gt;
  
  
  
          &lt;/Col&gt;
  
        &lt;/Row&gt;
  
      &lt;/div&gt;
  
    )}
  }
  
  export default App;
  </code></pre>
  
  <p>With this</p>
  
  <pre><code>this.myRef = React.createRef()
  
  this.myRef2 = React.createRef()
  </code></pre>
  
  <p>I can change the value of my div and works but I want to know if I can join this two in only one <code>react.createRef()</code> like array or I dont know. Thanks for any help!!</p>