Skip to content

Commit 3d7e1fe

Browse files
authored
fix: error message display when a ResourceProvider is missing (#602)
1 parent 3183c23 commit 3d7e1fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react/src/hooks/context/useSanityInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const useSanityInstance = (config?: SanityConfig): SanityInstance => {
6262

6363
if (!instance) {
6464
throw new Error(
65-
`SanityInstance context not found. ${config ? `Requested config: ${JSON.stringify(config, null, 2)}. ` : ''}Please ensure that your component is wrapped in a <ResourceProvider> or a <SanityApp>.`,
65+
`SanityInstance context not found. ${config ? `Requested config: ${JSON.stringify(config, null, 2)}. ` : ''}Please ensure that your component is wrapped in a ResourceProvider or a SanityApp component.`,
6666
)
6767
}
6868

@@ -72,7 +72,7 @@ export const useSanityInstance = (config?: SanityConfig): SanityInstance => {
7272
if (!match) {
7373
throw new Error(
7474
`Could not find a matching Sanity instance for the requested configuration: ${JSON.stringify(config, null, 2)}.
75-
Please ensure there is a <ResourceProvider> with a matching configuration in the component hierarchy.`,
75+
Please ensure there is a ResourceProvider component with a matching configuration in the component hierarchy.`,
7676
)
7777
}
7878

0 commit comments

Comments
 (0)