Skip to content

Commit

Permalink
fix: remove deprecated Function.prototype.caller reference (#3806)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
simmerer authored Nov 9, 2024
1 parent 7a59187 commit f86e2bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/four-dogs-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphiql/react': minor
---

Fix: removed deprecated usage of Fn.prototype.caller
2 changes: 1 addition & 1 deletion packages/graphiql-react/src/utility/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function createContextHook<T>(context: Context<T | null>) {
if (value === null && options?.nonNull) {
throw new Error(
`Tried to use \`${
options.caller?.name || useGivenContext.caller.name
options.caller?.name || 'a component'
}\` without the necessary context. Make sure to render the \`${
context.displayName
}Provider\` component higher up the tree.`,
Expand Down

0 comments on commit f86e2bc

Please sign in to comment.