fix(core): resolve unexpected forwardRef warning (#7527)

This commit is contained in:
Cats Juice
2024-07-17 18:08:59 +08:00
committed by GitHub
parent 4868f6e611
commit db3533724b
@@ -186,13 +186,17 @@ export const ViewSidebarTab = ({
}; };
export const ViewSidebarTabIconTarget = forwardRef( export const ViewSidebarTabIconTarget = forwardRef(
function ViewSidebarTabIconTarget({ function ViewSidebarTabIconTarget(
viewId, {
tabId, viewId,
...otherProps tabId,
}: React.HTMLProps<HTMLDivElement> & { tabId: string; viewId: string }) { ...otherProps
}: React.HTMLProps<HTMLDivElement> & { tabId: string; viewId: string },
ref: Ref<HTMLDivElement>
) {
return ( return (
<ViewIslandTarget <ViewIslandTarget
ref={ref}
id={`${viewId}:sidebar:${tabId}:icon`} id={`${viewId}:sidebar:${tabId}:icon`}
{...otherProps} {...otherProps}
/> />
@@ -201,16 +205,20 @@ export const ViewSidebarTabIconTarget = forwardRef(
); );
export const ViewSidebarTabBodyTarget = forwardRef( export const ViewSidebarTabBodyTarget = forwardRef(
function ViewSidebarTabBodyTarget({ function ViewSidebarTabBodyTarget(
viewId, {
tabId, viewId,
...otherProps tabId,
}: React.HTMLProps<HTMLDivElement> & { ...otherProps
tabId: string; }: React.HTMLProps<HTMLDivElement> & {
viewId: string; tabId: string;
}) { viewId: string;
},
ref: Ref<HTMLDivElement>
) {
return ( return (
<ViewIslandTarget <ViewIslandTarget
ref={ref}
id={`${viewId}:sidebar:${tabId}:body`} id={`${viewId}:sidebar:${tabId}:body`}
{...otherProps} {...otherProps}
/> />