// src/App.jsx
import { BrowserRouter, Routes, Route, NavLink } from "react-router-dom";
function HomePage() {
return
Home
;
}
function AboutPage() {
return About
;
}
function ContactPage() {
return Contact
;
}
function NavBar() {
const linkStyle = ({ isActive }) => ({
fontWeight: isActive ? "bold" : "normal",
color: isActive ? "#61dafb" : "inherit",
});
return (
);
}
function App() {
return (
} />
} />
} />
);
}
export default App;
/*
Notes:
- NavLink's style prop accepts a function receiving { isActive },
letting the active link's appearance differ without manually
comparing the current URL anywhere.
- All three pages render inside the same BrowserRouter, with NavBar
staying mounted and visible regardless of which page is active.
*/