I've encountered an issue where clicking the link in my app doesn't produce any result, and I'm unsure of the cause.
Below is the content of my app.js file:
import './App.css';
import {BrowserRouter as Router, Routes, Route} from 'react-router-dom';
import Homepage from "../src/pages/homepage";
import About from "./pages/about"
import Navbar from "../src/components/navbar";
function App() {
return (
<div className="App">
<Router>
<Navbar />
<Routes>
<Route path="/" element={<Homepage />} />
<Route path="/about" element={<About />} />
</Routes>
</Router>
</div>
);
}
export default App;
Here is the code snippet from my about.js file:
import React from 'react';
import { Link } from 'react-router-dom';
function about(){
return(
<div>
<Link to="/" >
click to go back
</Link>
</div>
);
}
export default about;
I have attempted using buttons, anchor tags, etc., but nothing happens when I click on them.