Skip to content

Commit f86e2bc

Browse files
authored
fix: remove deprecated Function.prototype.caller reference (#3806)
* fix: remove deprecated Function.prototype.caller reference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_caller_or_arguments_usage note: this may cause bugs if you execute operations quickly enough that one does not complete before the other. to ameliorate, ensure that the last operation request is complete before executing another
1 parent 7a59187 commit f86e2bc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/four-dogs-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphiql/react': minor
3+
---
4+
5+
Fix: removed deprecated usage of Fn.prototype.caller

packages/graphiql-react/src/utility/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function createContextHook<T>(context: Context<T | null>) {
2121
if (value === null && options?.nonNull) {
2222
throw new Error(
2323
`Tried to use \`${
24-
options.caller?.name || useGivenContext.caller.name
24+
options.caller?.name || 'a component'
2525
}\` without the necessary context. Make sure to render the \`${
2626
context.displayName
2727
}Provider\` component higher up the tree.`,

0 commit comments

Comments
 (0)