I am currently struggling with nesting routes using react router v4.
The closest example was the route config in the React-Router v4 Documentation.
I want t
A complete answer for React Router v6 or version 6 just in case needed.
import Dashboard from "./dashboard/Dashboard";
import DashboardDefaultContent from "./dashboard/dashboard-default-content";
import { Route, Routes } from "react-router";
import { useRoutes } from "react-router-dom";
/*Routes is used to be Switch*/
const Router = () => {
return (
} />
} />
} />
}>
} />
} />
} />
} />
} />
);
};
export default Router;
import DashboardSidebarNavigation from "./dashboard-sidebar-navigation";
import { Grid } from "@material-ui/core";
import { Outlet } from "react-router";
const Dashboard = () => {
return (
);
};
export default Dashboard;
Github repo is here. https://github.com/webmasterdevlin/react-router-6-demo