Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/query-devtools/src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ export const deleteNestedDataByPath = (
// Adds a nonce to the style tag if needed
export const setupStyleSheet = (nonce?: string, target?: ShadowRoot) => {
if (!nonce) return

// goober 2.1.17+ reads window.__nonce__ to set the nonce on every style
// element access. We must set it here so goober picks it up instead of
// overwriting our nonce with undefined.
;(window as any).__nonce__ = nonce

const styleExists =
document.querySelector('#_goober') || target?.querySelector('#_goober')

Expand Down