From 27eb5978a9c437fd1f23640f9d07a4d88c16a226 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 28 Apr 2023 12:19:45 -0700 Subject: [PATCH] Pass TableManager instance to Details sidebar of any MasterDetail table Summary: Project: https://docs.google.com/document/d/1SbFrpvfIShX5npANNa1AkgHliR1M-VMLW5Q9RhREt94/edit# Reviewed By: passy Differential Revision: D45354900 fbshipit-source-id: 7f968c9d235f5d8bb23e59e50e39fc1e9f498f46 --- desktop/flipper-plugin/src/ui/MasterDetail.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-plugin/src/ui/MasterDetail.tsx b/desktop/flipper-plugin/src/ui/MasterDetail.tsx index 7fb70b769..2a8c4474f 100644 --- a/desktop/flipper-plugin/src/ui/MasterDetail.tsx +++ b/desktop/flipper-plugin/src/ui/MasterDetail.tsx @@ -46,7 +46,10 @@ type MasterDetailProps = { * Component that accepts a 'record' prop that is used to render details. * If none is provided, a standard `DataInspector` component will be used to display the entire record. */ - sidebarComponent?: React.FC<{record: T}>; + sidebarComponent?: React.FC<{ + record: T; + tableManagerRef?: React.RefObject | undefined>; + }>; /** * Default size of the sidebar. */ @@ -114,6 +117,7 @@ export function MasterDetail({ sidebarPosition !== 'none' && selectedRecord && sidebarComponent ? createElement(sidebarComponent, { record: selectedRecord, + tableManagerRef, }) : null;