title: How to remove anchor tag from URL in React
body: <p>So I have a single page application built in React, and I want to have it so when I click a link in my navbar it scrolls to that component but doesn't change the URL or adds the href anchor to the URL.</p>
  
  <p>For example, when I click the "About" link it scrolls my page to where I have the About component but changes the URL from "localhost:3000" to "localhost:3000/#about". What can I do so when I click any link in my nav bar it scrolls to where I have that component displayed but leaves the URL as "localhost:3000"?</p>
  
  <p>Here's my navbar code:</p>
  
  <pre><code>import React from 'react';
  import './styles.css';
  
  class Navbar extends React.Component{
      render(){
          return(
              &lt;div className="navbar"&gt;
                  &lt;li&gt; &lt;a href="#about"&gt; About &lt;/a&gt; &lt;/li&gt;
                  &lt;li&gt; &lt;a href="#experience"&gt; Experience &lt;/a&gt; &lt;/li&gt;
                  &lt;li&gt; &lt;a href="#education"&gt; Education &lt;/a&gt; &lt;/li&gt;
                  &lt;li&gt; &lt;a href="#portfolio"&gt; Portfolio &lt;/a&gt; &lt;/li&gt;
              &lt;/div&gt;
          )
      }
  }
  export default Navbar;
  </code></pre>