From 6c36aee9443d4b30d13137dbb1660f73522aa3c9 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 2 May 2022 18:17:01 -0700 Subject: [PATCH] Fixed wrong method call for LRU cache (#24477) --- .../react-devtools-shared/src/inspectedElementMutableSource.js | 2 +- packages/react-devtools-shared/src/types.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-devtools-shared/src/inspectedElementMutableSource.js b/packages/react-devtools-shared/src/inspectedElementMutableSource.js index b5ea32b960823..d91d8de8c1de4 100644 --- a/packages/react-devtools-shared/src/inspectedElementMutableSource.js +++ b/packages/react-devtools-shared/src/inspectedElementMutableSource.js @@ -102,7 +102,7 @@ export function inspectElement({ case 'not-found': // This is effectively a no-op. // If the Element is still in the Store, we can eagerly remove it from the Map. - inspectedElementCache.remove(id); + inspectedElementCache.del(id); throw Error(`Element "${id}" not found`); diff --git a/packages/react-devtools-shared/src/types.js b/packages/react-devtools-shared/src/types.js index 6eb3e2f3a7686..ca0943ac9234d 100644 --- a/packages/react-devtools-shared/src/types.js +++ b/packages/react-devtools-shared/src/types.js @@ -86,9 +86,9 @@ export type HookSourceLocationKey = string; export type HookNames = Map; export type LRUCache = {| + del: (key: K) => void, get: (key: K) => V, has: (key: K) => boolean, - remove: (key: K) => void, reset: () => void, set: (key: K, value: V) => void, |};