forked from vercel/ai-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: @radix-ui/react-presence memory leak
- Loading branch information
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,9 @@ | |
"postcss": "8.4.49", | ||
"swr": "2.2.6-beta.4", | ||
"use-sync-external-store": "1.4.0" | ||
}, | ||
"patchedDependencies": { | ||
"@radix-ui/[email protected]": "patches/@[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/dist/index.js b/dist/index.js | ||
index 5d139c059b54dd3a6578121a95386241e82c87c7..741e7250d91d95c4fd94ac7b11d5f8c342255694 100644 | ||
--- a/dist/index.js | ||
+++ b/dist/index.js | ||
@@ -145,7 +145,11 @@ function usePresence(present) { | ||
return { | ||
isPresent: ["mounted", "unmountSuspended"].includes(state), | ||
ref: React2.useCallback((node2) => { | ||
- if (node2) stylesRef.current = getComputedStyle(node2); | ||
+ if (node2) { | ||
+ stylesRef.current = getComputedStyle(node2); | ||
+ } else { | ||
+ stylesRef.current = {}; | ||
+ } | ||
setNode(node2); | ||
}, []) | ||
}; | ||
diff --git a/dist/index.mjs b/dist/index.mjs | ||
index 5ab5280818c2471068756b1122c11463b5e19a18..03073875f284f40abf15c72c7fea2292ee63e518 100644 | ||
--- a/dist/index.mjs | ||
+++ b/dist/index.mjs | ||
@@ -110,7 +110,11 @@ function usePresence(present) { | ||
return { | ||
isPresent: ["mounted", "unmountSuspended"].includes(state), | ||
ref: React2.useCallback((node2) => { | ||
- if (node2) stylesRef.current = getComputedStyle(node2); | ||
+ if (node2) { | ||
+ stylesRef.current = getComputedStyle(node2); | ||
+ } else { | ||
+ stylesRef.current = {} as any; | ||
+ } | ||
setNode(node2); | ||
}, []) | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.