React Router Typescript is "joining" several html pages and their css completely breaking my application
P粉838563523
P粉838563523 2023-09-12 16:28:21
0
2
390

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(           ) } 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

P粉838563523
P粉838563523

reply all (2)
P粉242741921

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.

    P粉574695215

    Try this:

    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(   }> }> }> }> }> }>   ) } export default MyRoutes;
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!