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
This commit is contained in:
John Knox
2020-03-23 08:52:06 -07:00
committed by Facebook GitHub Bot
parent ef653100ed
commit 043fcc354f

View File

@@ -47,7 +47,7 @@ export default function ContextMenu<C>({
} else if (buildItems != null) { } else if (buildItems != null) {
contextMenuManager?.appendToContextMenu(buildItems()); contextMenuManager?.appendToContextMenu(buildItems());
} }
}, []); }, [items, buildItems]);
return createElement( return createElement(
component || FlexColumn, component || FlexColumn,
{ {