title: React - How to open PDF file as a href target blank
body: <p>This mundane task fairly simple on static views, isn't complying with React.</p>
  
  <p>Can someone advise me how to open a pdf file as a href on a new tab?</p>
  
  <p>Here's my code using react-bootstrap and react-router:</p>
  
  <pre><code>    &lt;NavDropdown eventKey={3} title="Forms"&gt;
  
          &lt;MenuItem eventKey={3.1} href="https://www.google.com/" target="_blank"&gt;Form 1&lt;/MenuItem&gt;
  
          &lt;MenuItem eventKey={3.2} href="samba.pdf" target="_blank"&gt;Form 2&lt;/MenuItem&gt;
      &lt;/NavDropdown&gt; 
  </code></pre>
  
  <p>The external link to google works fine.</p>
  
  <p>The pdf (saved on same level directory as the code above) doesnt.</p>
  
  <p>When I click on the pdf link it redirects me to my "404 catch all" route.</p>
  
  <pre><code>    &lt;Switch&gt;
          &lt;Route path="/" exact component={Home} /&gt;
          &lt;Route path="/contact" exact component={Contact} /&gt;
          &lt;Route path="/about" exact component={About} /&gt;
          &lt;Route component={NotFound} /&gt;
      &lt;/Switch&gt;;
  </code></pre>
  
  <p><strong>EDIT:</strong>
  Solution here:
  <a href="https://stackoverflow.com/questions/47718289/view-download-pdf-files-in-react-router-4">answered by Link_Cable</a></p>