React – How to open PDF file as a href target blank

Place the pdf into a folder in /src. Import it like a component. Set href parameter as the imported pdf and the target = “_blank”. import React, { Component } from ‘react’; import Pdf from ‘../Documents/Document.pdf’; class Download extends Component { render() { return ( <div className = “App”> <a href = {Pdf} target = … Read more

ReactJS Bootstrap Navbar and Routing not working together

First of all, in your snippets it doesn’t seem like you’re wrapping your code in a Router, so you should make sure that you’re doing that inside App or in ReactDOM.render: import { BrowserRouter } from ‘react-router-dom’; ReactDOM.render( <BrowserRouter> <App /> </BrowserRouter>, rootElement ); Next, your specific problem is that you’re rendering react-bootstrap’s Nav.Link instead … Read more