Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/ribbon): crash due to misuse of component rendering

Elian Doran26132a2a5639
diff --git a/apps/client/src/widgets/ribbon/Ribbon.tsx b/apps/client/src/widgets/ribbon/Ribbon.tsx
index 61f68fe514..53813b1f41 100644
--- a/apps/client/src/widgets/ribbon/Ribbon.tsx
+++ b/apps/client/src/widgets/ribbon/Ribbon.tsx
@@ -224,20 +224,22 @@ export default function Ribbon() {
return;
}
+ const TabContent = tab.content;
+
return (
<div className={`ribbon-body ${!isActive ? "hidden-ext" : ""}`}>
- {tab?.content && tab.content({
- note,
- hidden: !isActive,
- ntxId,
- hoistedNoteId,
- notePath,
- noteContext,
- componentId,
- activate: useCallback(() => {
+ <TabContent
+ note={note}
+ hidden={!isActive}
+ ntxId={ntxId}
+ hoistedNoteId={hoistedNoteId}
+ notePath={notePath}
+ noteContext={noteContext}
+ componentId={componentId}
+ activate={useCallback(() => {
setActiveTabIndex(tab.index)
- }, [setActiveTabIndex])
- })}
+ }, [setActiveTabIndex])}
+ />
</div>
);
})}