I have been working with react-router-dom for quite a time but not faced this problem at all, everything working fine with the navbar image when I'm in the "/" root address but when I route to /student/view/:id the navbar image is not loading!
Here's the code!!
Main file code:
<Router>
<div className="App">
<Navbar />
<Switch>
<Route exact path="/" component={StudentCard} />
<Route exact path="/student/view/:id" component={StudentView} />
</Switch>
</div>
</Router>
Navbar file code:
<nav className="navbar navbar-expand-sm navbar-light bg-white">
<div className="container">
<Link className="navbar-brand" to="/">
<img src="assets/images/administrator.png" height="50px" alt="admin" />
</Link>
assetsa folder in your public directory/assets/images/administrator.png, plus remember to check the network tab for more info about the error ( or weird behaviour )