Skip to content

Commit

Permalink
add missing effect dep for default headers (#2912)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed Nov 15, 2022
1 parent 118db40 commit 83364b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/red-ligers-scream.md
@@ -0,0 +1,6 @@
---
'@graphiql/react': patch
---

Add missing effect dependency to make sure updates to the `defaultHeaders` prop
have the desired effect
8 changes: 7 additions & 1 deletion packages/graphiql-react/src/editor/context.tsx
Expand Up @@ -329,7 +329,13 @@ export function EditorContextProvider(props: EditorContextProviderProps) {
onTabChange?.(updated);
return updated;
});
}, [onTabChange, setEditorValues, storeTabs, synchronizeActiveTabValues]);
}, [
props.defaultHeaders,
onTabChange,
setEditorValues,
storeTabs,
synchronizeActiveTabValues,
]);

const changeTab = useCallback<EditorContextType['changeTab']>(
index => {
Expand Down

1 comment on commit 83364b2

@Huntercry
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.