From 9b107289a279fdfac466994a236d700bf146a63a Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Fri, 13 Dec 2024 19:21:58 +0100 Subject: [PATCH] fix: ensure app id cache is safe --- .../src/core/create/context/SanityCreateConfigProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx b/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx index e604546cd0d..d1ae36a1105 100644 --- a/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx +++ b/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx @@ -1,4 +1,4 @@ -import {type ReactNode, useMemo} from 'react' +import {type ReactNode, useMemo, useState} from 'react' import {SanityCreateConfigContext} from 'sanity/_singletons' import {useSource} from '../../studio' @@ -19,7 +19,7 @@ export function SanityCreateConfigProvider(props: SanityCreateConfigProviderProp const {children} = props const {beta} = useSource() - const appIdCache = useMemo(() => createAppIdCache(), []) + const [appIdCache] = useState(() => createAppIdCache()) const value = useMemo((): SanityCreateConfigContextValue => { return {