From db3533724bf6a59699b75f316dd638b76d4e85ad Mon Sep 17 00:00:00 2001 From: Cats Juice Date: Wed, 17 Jul 2024 18:08:59 +0800 Subject: [PATCH] fix(core): resolve unexpected forwardRef warning (#7527) --- .../modules/workbench/view/view-islands.tsx | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/packages/frontend/core/src/modules/workbench/view/view-islands.tsx b/packages/frontend/core/src/modules/workbench/view/view-islands.tsx index a667937bd5..928f65e6a3 100644 --- a/packages/frontend/core/src/modules/workbench/view/view-islands.tsx +++ b/packages/frontend/core/src/modules/workbench/view/view-islands.tsx @@ -186,13 +186,17 @@ export const ViewSidebarTab = ({ }; export const ViewSidebarTabIconTarget = forwardRef( - function ViewSidebarTabIconTarget({ - viewId, - tabId, - ...otherProps - }: React.HTMLProps & { tabId: string; viewId: string }) { + function ViewSidebarTabIconTarget( + { + viewId, + tabId, + ...otherProps + }: React.HTMLProps & { tabId: string; viewId: string }, + ref: Ref + ) { return ( @@ -201,16 +205,20 @@ export const ViewSidebarTabIconTarget = forwardRef( ); export const ViewSidebarTabBodyTarget = forwardRef( - function ViewSidebarTabBodyTarget({ - viewId, - tabId, - ...otherProps - }: React.HTMLProps & { - tabId: string; - viewId: string; - }) { + function ViewSidebarTabBodyTarget( + { + viewId, + tabId, + ...otherProps + }: React.HTMLProps & { + tabId: string; + viewId: string; + }, + ref: Ref + ) { return (