title: How to scroll to element of the list in other component?
body: <p>How to scroll to element of the list in other component?</p>
  
  <pre><code>class Posts extends Components {
    render() {
      &lt;ul&gt;
       {this.props.posts.map((post) =&gt; 
          &lt;li key={post.id}&gt;{post.title}&lt;/li&gt;
       )} 
      &lt;/ul&gt;
    }
  
     //redux
  }
  
  class OtherComponent extends Components {
    onClickHandler = (id) =&gt; {
       //!!!!!!!!
       //scroll page to li with key={post.id}
    }
  
    render() {
      &lt;div&gt;
       {this.props.posts.map((post) =&gt; 
          &lt;div key={post.id} onClick={() =&gt; this.onClickHandler(post.id)}&gt;{post.title}&lt;/div&gt;
       )} 
      &lt;/div&gt;
    }
  
     //redux
  }
  </code></pre>
  
  <p>I found solutions here: <a href="https://stackoverflow.com/questions/43441856/reactjs-how-to-scroll-to-an-element">ReactJS how to scroll to an element</a></p>
  
  <p>but all are for single element.</p>
  
  <p>If I have list, I need to create a reference to everyone? The list of posts can change, so I can not do it.</p>