title: React Scroll to another page Not working react-scroll
body: <p>I have a page where each component has scroll functionality. But it will come from another page.
  Like on the Home page route is &quot;/&quot; I have set the scroll with</p>
  <pre><code>import { Link as Scrolllink, animateScroll as scroll } from 'react-scroll'
  
                   
  
              &lt;Scrolllink
                          onClick={() =&gt; history.push('/services')}
                          to=&quot;DayCare&quot;
                          spy={true}
                          smooth={true}
                          hashSpy={true}
                          isDynamic={true}
                          
  
                      &gt;
                          Day care
                     &lt;/Scrolllink&gt;
  
  
         &lt;Scrolllink
                         onClick={() =&gt; history.push('/services')}
                          to=&quot;Office&quot;
                          spy={true}
                          smooth={true}
                          hashSpy={true}
                          isDynamic={true}
                          
  
                      &gt;
                          Office
                     &lt;/Scrolllink&gt;
  </code></pre>
  <p>Similar to this I have set for all the target elements.
  Now In-service page I ave added the id of that target before that components</p>
  <pre><code>  &lt;div id=&quot;DayCare&quot;&gt; &lt;DayCare /&gt;&lt;/div&gt;
         &lt;div id=&quot;HomeApartment&quot;&gt; &lt;HomeApartment/&gt;&lt;/div&gt;
         &lt;div id=&quot;Office&quot;&gt; &lt;Office/&gt;&lt;/div&gt;
         &lt;div id=&quot;MoveInOut&quot;&gt; &lt;MoveInOut/&gt;&lt;/div&gt;
         &lt;div id=&quot;Construction&quot;&gt; &lt;Construction/&gt;&lt;/div&gt;
         &lt;div  id=&quot;Airbnb&quot;&gt; &lt;Airbnb/&gt;&lt;/div&gt;
         &lt;div id=&quot;Carpet&quot;&gt; &lt;Carpet/&gt;&lt;/div&gt;
         &lt;div id=&quot;Infection&quot;&gt; &lt;Infection/&gt;&lt;/div&gt;
  </code></pre>
  <p>But I am pushing to the &quot;/service&quot; page, but not scrolled to target id:
  If I click on On the link I going to a random component, not the one I have targeted.
  How to fix this problem.</p>