From 120cb3c6747193277061cef925ecfe82f57733a2 Mon Sep 17 00:00:00 2001 From: "stilyan.tinloof" Date: Tue, 7 Jan 2025 18:40:04 +0000 Subject: [PATCH] remove query and variables from deps --- .changeset/loud-horses-rush.md | 5 +++++ .../sanity-studio/src/plugins/navigator/utils/index.tsx | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/loud-horses-rush.md diff --git a/.changeset/loud-horses-rush.md b/.changeset/loud-horses-rush.md new file mode 100644 index 00000000..23ea588c --- /dev/null +++ b/.changeset/loud-horses-rush.md @@ -0,0 +1,5 @@ +--- +"@tinloof/sanity-studio": patch +--- + +Navigator hotfix diff --git a/packages/sanity-studio/src/plugins/navigator/utils/index.tsx b/packages/sanity-studio/src/plugins/navigator/utils/index.tsx index d9c1cc10..43274634 100644 --- a/packages/sanity-studio/src/plugins/navigator/utils/index.tsx +++ b/packages/sanity-studio/src/plugins/navigator/utils/index.tsx @@ -25,8 +25,9 @@ export const useSanityFetch = ({ documentStore.listenQuery(query, variables, { perspective: "previewDrafts", }), - [documentStore, query, variables], - ), + // eslint-disable-next-line react-hooks/exhaustive-deps + [documentStore] + ) ); const loading = subscribe === undefined; @@ -155,7 +156,7 @@ export function createPageTemplates(creatablePages: NormalizedCreatablePage[]) { } export function normalizeCreatablePages( - creatablePageTypes: PagesNavigatorPluginOptions["creatablePages"], + creatablePageTypes: PagesNavigatorPluginOptions["creatablePages"] ): NormalizedCreatablePage[] { return ( creatablePageTypes?.map((page) => {