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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}
/>
@ -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}
/>