feat: add redirect on index page of components
This commit is contained in:
parent
5635888066
commit
9580007a10
@ -3,6 +3,7 @@ import {
|
|||||||
createBrowserRouter,
|
createBrowserRouter,
|
||||||
createRoutesFromElements,
|
createRoutesFromElements,
|
||||||
RouterProvider,
|
RouterProvider,
|
||||||
|
redirect,
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
import MainLayout from "./MainLayout";
|
import MainLayout from "./MainLayout";
|
||||||
import Home from "./Home";
|
import Home from "./Home";
|
||||||
@ -19,6 +20,9 @@ const router = createBrowserRouter(
|
|||||||
<Route path="/docs" element={<DocsLayout />}>
|
<Route path="/docs" element={<DocsLayout />}>
|
||||||
<Route index element={<DocsIntroduction />} />
|
<Route index element={<DocsIntroduction />} />
|
||||||
<Route path="installation" element={<DocsInstallation />} />
|
<Route path="installation" element={<DocsInstallation />} />
|
||||||
|
<Route path="components">
|
||||||
|
<Route index loader={() => redirect("/docs/components/button")} />
|
||||||
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user