Hi guys I was starting out on React and came across this problem, this is my Navbar component:
import { BrowserRouter as NavLink } from "react-router-dom";
const Navbar = () => {
return (
<>
<NavLink as={NavLink} exact to="/">
Hello
</NavLink>
</>
);
};
export default Navbar;
and this is my App.js:
import "./App.css";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Navbar from "./Components/Navbar";
const App = () => {
return <Navbar />;
};
export default App;
when I run the code this is what happens:
Also the link is not clickable nor has an underline like when using a simple tag And what's even worse is that if I change the import statement in my Navbar.js from:
import { BrowserRouter as NavLink } from "react-router-dom";
to
import { NavLink } from "react-router-dom";
everything goes blank:
my react-router-dom version is "^6.3.0"
please help I have seen different articles and I couldn't come up with a solution