import { BrowserRouter, Route, Routes } from "react-router-dom"; import PacientsPage from "../components/mainPage/pacientesPage/pacietspage"; import Mainpage from "../components/mainPage/mainpage"; import BedsPage from "../components/mainPage/bedsPage/bedspage"; import DoctorsPage from "../components/mainPage/doctorsPage/doctorsPage"; import InternationPage from "../components/mainPage/internationsPage/internationpage"; import LoginPage from "../components/loginPage/loginpage"; const MyRoutes = () => { return( <BrowserRouter> <Routes> <Route path="/*" Component={Mainpage}></Route> <Route path="/login" Component={LoginPage}></Route> <Route path="/patients" Component={PacientsPage}></Route> <Route path="/beds" Component={BedsPage}></Route> <Route path="/doctors" Component={DoctorsPage}></Route> <Route path="/internations" Component={InternationPage}></Route> </Routes> </BrowserRouter> ) } export default MyRoutes;
My goal is just to navigate between pages but now nothing works I calmly went to do my navigation and I ran into a problem where react started asking for "index.js" and from the beginning I was doing it in a typescript template so since I didn't find a solution I started one new app and passed my component to the new app and rewrote the router and from then on it's like this
I think this is your main/index page.
As a learner, I could be wrong, but adding
/*
would make it a wildcard route. This means anything you put after/
will go to the
component.Try this: