Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

moves useTableRowsPrefetchWrapper

Alaister Young3270b643f1a5
diff --git a/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx b/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx
index 0ba39aab31a..bd25b07380e 100644
--- a/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx
+++ b/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx
@@ -12,8 +12,8 @@ import TableEditorMenu from './TableEditorMenu'
import NoPermission from 'components/ui/NoPermission'
import useEntityType from 'hooks/misc/useEntityType'
import Connecting from 'components/ui/Loading/Loading'
-import useTableRowsPrefetch from 'hooks/misc/useTableRowsPrefetch'
import useLatest from 'hooks/misc/useLatest'
+import useTableRowsPrefetchWrapper from './TableEditorLayout.utils'
export interface TableEditorLayoutProps {
selectedSchema?: string
@@ -64,7 +64,7 @@ const TableEditorLayout = ({
})
})
- const prefetch = useLatest(useTableRowsPrefetch())
+ const prefetch = useLatest(useTableRowsPrefetchWrapper())
useEffect(() => {
let mounted = true
diff --git a/studio/hooks/misc/useTableRowsPrefetch.ts b/studio/components/layouts/TableEditorLayout/TableEditorLayout.utils.ts
similarity index 83%
rename from studio/hooks/misc/useTableRowsPrefetch.ts
rename to studio/components/layouts/TableEditorLayout/TableEditorLayout.utils.ts
index 74dcae5e95e..2d4340bb3c0 100644
--- a/studio/hooks/misc/useTableRowsPrefetch.ts
+++ b/studio/components/layouts/TableEditorLayout/TableEditorLayout.utils.ts
@@ -6,9 +6,9 @@ import { useUrlState } from 'hooks'
import { useCallback } from 'react'
/**
- * useTableRowsPrefetch is a wrapper around the base useTableRowsPrefetch that prefills the sort and filter params
+ * useTableRowsPrefetchWrapper is a wrapper around the base useTableRowsPrefetch that prefills the sort and filter params
*/
-function useTableRowsPrefetch() {
+function useTableRowsPrefetchWrapper() {
const [{ sort, filter }] = useUrlState({
arrayKeys: ['sort', 'filter'],
})
@@ -34,4 +34,4 @@ function useTableRowsPrefetch() {
)
}
-export default useTableRowsPrefetch
+export default useTableRowsPrefetchWrapper