Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

fix: use WeakMap instead of Map to avoid memory leaks (#44)

HelKyle3cb964cc18bd
diff --git a/src/index.tsx b/src/index.tsx
index 1bf4ff8..b1a30fb 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -28,7 +28,7 @@ const NESTED_DISPLACEMENT = 16;
const WINDOW_TOP_OFFSET = 26;
-const cache = new Map();
+const cache = new WeakMap();
interface Style {
[key: string]: string;