Was following a tutorial and my localhost is completely blank after importing {Link} from react-router-dom. Followed word for word but my local host is blank as soon as I added link in navbar.js. Please help.
import React from 'react';
import {Link} from 'react-router-dom';
function Navbar() {
return(
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<Link to="/" class="navbar-brand">SkyCloud</Link>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-togglser-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<Link to="/" class="nav-link active">Home</Link>
</li>
<li class="nav-item">
<Link to="/about" class="nav-link active">About</Link>
</li>
<li class="nav-item">
<Link to="/contact" class="nav-link active">Contact</Link>
</li>
</ul>
</div>
</div>
</nav>
);
}
export default Navbar;
And this is my App.js file…
import React from 'react';
import Navbar from './components/inc/Navbar';
import Home from './components/pages/Home';
import About from './components/pages/About';
import Contact from './components/pages/Contact';
import {BrowserRouter as Router} from 'react-router-dom';
function App() {
return (
<Router>
<div>
<Navbar/>
<Home/>
<About/>
<Contact/>
</div>
</Router>
);
}
export default App;
Please help(this is my first question btw).