From 043fcc354f6a4aa512fc8b8297d56b05ee85877f Mon Sep 17 00:00:00 2001 From: John Knox Date: Mon, 23 Mar 2020 08:52:06 -0700 Subject: [PATCH] Fix context menu caching bug Summary: The memoized callback didn't have any dependencies, so whenever a context menu was computed for a component, it was never changed again. This broke the network plugin as the context menu should change depending on what element is selected. Reviewed By: cekkaewnumchai Differential Revision: D20596750 fbshipit-source-id: 275453d972079954e310fd3e97f2dd9f437bf748 --- desktop/app/src/ui/components/ContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/app/src/ui/components/ContextMenu.tsx b/desktop/app/src/ui/components/ContextMenu.tsx index bd1ca9995..0e9d3f555 100644 --- a/desktop/app/src/ui/components/ContextMenu.tsx +++ b/desktop/app/src/ui/components/ContextMenu.tsx @@ -47,7 +47,7 @@ export default function ContextMenu({ } else if (buildItems != null) { contextMenuManager?.appendToContextMenu(buildItems()); } - }, []); + }, [items, buildItems]); return createElement( component || FlexColumn, {