Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

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

Cats Juicedb3533724bf6
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<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}
/>