title: Leading Hashtag In A React Router Path
body: <p>I'm refactoring an API front-end from jQuery to React and in order to keep the site backward-compatible, I have to keep the current URL formatting to match: <code>www.site.com/#parameter</code>, which has a leading hashtag in the pathname. The problem comes when trying to route the pathname to match this format, React Router doesn't recognize the route or render the corresponding components. When trying to console.log the useParams object, it returns undefined.</p>
  <p>TLDR; How can I access a URL parameter that starts with a ‘#’?</p>
  <pre><code>import {Switch, Route} from &quot;react-router-dom&quot;
  import Home from &quot;./Home&quot;
  
  
  function Routes() {
    return (
      &lt;div&gt;
        &lt;Switch&gt;
          &lt;Route exact path={`/#:parameter`}&gt;&lt;Home/&gt;&lt;/Route&gt;
        &lt;/Switch&gt;
      &lt;/div&gt;
    )
  
  }
  
  export default Routes;
  </code></pre>