Skip to content

Commit

Permalink
fix(core): resolve unexpected forwardRef warning (#7527)
Browse files Browse the repository at this point in the history
  • Loading branch information
CatsJuice committed Jul 17, 2024
1 parent 4868f6e commit db35337
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions packages/frontend/core/src/modules/workbench/view/view-islands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,17 @@ export const ViewSidebarTab = ({
};

export const ViewSidebarTabIconTarget = forwardRef(
function ViewSidebarTabIconTarget({
viewId,
tabId,
...otherProps
}: React.HTMLProps<HTMLDivElement> & { tabId: string; viewId: string }) {
function ViewSidebarTabIconTarget(
{
viewId,
tabId,
...otherProps
}: React.HTMLProps<HTMLDivElement> & { tabId: string; viewId: string },
ref: Ref<HTMLDivElement>
) {
return (
<ViewIslandTarget
ref={ref}
id={`${viewId}:sidebar:${tabId}:icon`}
{...otherProps}
/>
Expand All @@ -201,16 +205,20 @@ export const ViewSidebarTabIconTarget = forwardRef(
);

export const ViewSidebarTabBodyTarget = forwardRef(
function ViewSidebarTabBodyTarget({
viewId,
tabId,
...otherProps
}: React.HTMLProps<HTMLDivElement> & {
tabId: string;
viewId: string;
}) {
function ViewSidebarTabBodyTarget(
{
viewId,
tabId,
...otherProps
}: React.HTMLProps<HTMLDivElement> & {
tabId: string;
viewId: string;
},
ref: Ref<HTMLDivElement>
) {
return (
<ViewIslandTarget
ref={ref}
id={`${viewId}:sidebar:${tabId}:body`}
{...otherProps}
/>
Expand Down

0 comments on commit db35337

Please sign in to comment.