From 3a8226b8905348415df189ca99f6bc2f52c07649 Mon Sep 17 00:00:00 2001 From: James Wysynski Date: Fri, 24 Jun 2022 07:02:50 -0700 Subject: [PATCH] Support tabKey and key for tab keys Summary: Support tabKey and key properties for tab keys in Tabs/Tab. tabKey > tab > key > tab_{idx} Reviewed By: aigoncharov Differential Revision: D37412130 fbshipit-source-id: 56ade27a02a7ba2926534a81d92dd1e9229576f4 --- desktop/flipper-plugin/src/ui/Tabs.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-plugin/src/ui/Tabs.tsx b/desktop/flipper-plugin/src/ui/Tabs.tsx index 2378f0064..29f1be69c 100644 --- a/desktop/flipper-plugin/src/ui/Tabs.tsx +++ b/desktop/flipper-plugin/src/ui/Tabs.tsx @@ -30,7 +30,10 @@ export function Tabs({ return; } const tabKey = - (typeof child.props.tab === 'string' && child.props.tab) || `tab_${idx}`; + (typeof child.props.tabKey === 'string' && child.props.tabKey) || + (typeof child.props.tab === 'string' && child.props.tab) || + (typeof child.props.key === 'string' && child.props.key) || + `tab_${idx}`; keys.push(tabKey); return { ...child,