feat: add custom hooks for typed useDispatch and useSelector

This commit is contained in:
siujamo
2026-05-07 10:46:06 +08:00
parent 1a16199f2f
commit af58edbafd
8 changed files with 52 additions and 8 deletions
+5
View File
@@ -13,6 +13,8 @@ function lazy<T extends { default: ComponentType<unknown> }>(importer: () => Pro
}
}
const hydrateFallbackElement = <div className="px-4 py-6 text-gray-500">...</div>
/**
* Main application router configuration using React Router v6.
* Defines all routes and their corresponding components.
@@ -22,11 +24,13 @@ const router = createBrowserRouter(
{
path: "/",
element: <HeroLayout />,
hydrateFallbackElement,
errorElement: <ErrorPage />,
children: [
{
index: true,
lazy: lazy(() => import("@/page/firearms")),
},
{
path: "firearms",
@@ -40,6 +44,7 @@ const router = createBrowserRouter(
},
{
element: <EmptyLayout />,
hydrateFallbackElement,
errorElement: <ErrorPage />,
children: [
{