refactor: destructure loaderData in multiple components for cleaner code

This commit is contained in:
Ardeman
2025-03-09 09:32:51 +08:00
parent 09e5f84b8b
commit 0da2006e78
20 changed files with 34 additions and 42 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ export const CategoriesPage = () => {
const loaderData = useRouteLoaderData<typeof loader>(
'routes/_admin.lg-admin._dashboard.categories._index',
)
const categoriesData = loaderData?.dataCategories
const { dataCategories: categoriesData } = loaderData || {}
DataTable.use(DT)
const dataTable = categoriesData?.sort((a, b) => {