Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
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.tsxindex 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>);})}