I use react-router-dom V5. When I create Route component in my project I use <HashRouter>.
This is example of my component:
<HashRouter>
<Switch>
<Route path="/form" component={Login} />
<Route path="/admin" component={Panel} />
<Route path="/changepass" component={ChangePass} />
<Route path="*" component={NotFound} />
</Switch>
</HashRouter>
For example when I enter: "/akfakafk" it works correctly, but when I enter: "/admin/wtwtwtw" it's not working.
I know it is not implemented correctly,
I want to know, how can I implement this?
By the way in "/admin" render Panel component that has return another routes.
This is my panel routes:
const dashboardRoutes = [
{
path: "/dashboard",
name: dashboard,
icon: DashboardIcon,
component: DashboardPage,
layout: "/admin",
},
{
path: "/devicesManagement",
name: devicesManagement,
icon: DevicesIcon,
component: DevicesPage,
layout: "/admin",
}
]