This is how I'm assigning routes.
Routes = [
{
path: "/Hibachi/:id?",
component: HibachiGrill,
title: "Hibachi",
icon: <TableOutlined />,
exact: true,
},
{
path: "/Barfloor",
component: BarFloor,
title: "Barfloor",
icon: <RiDashboardFill />,
exact: true,
},
];
I'm calling the routes like this.
<LayoutAnt className="content">
<Switch>
{Routes.map((route, index) => (
<Route
key={index}
exact={route.exact}
path={route.path}
component={route.component}
/>
))}
</Switch>
</LayoutAnt>
My question is when I don't pass any parameter in the hibachi component I get this as result :id
I have tried putting a ? but I'm still facing the same problem.