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

This commit is contained in:
Elian Doran 2025-08-27 15:19:31 +03:00
parent d92bd16042
commit 26132a2a56
No known key found for this signature in database

View File

@ -224,20 +224,22 @@ export default function Ribbon() {
return; return;
} }
const TabContent = tab.content;
return ( return (
<div className={`ribbon-body ${!isActive ? "hidden-ext" : ""}`}> <div className={`ribbon-body ${!isActive ? "hidden-ext" : ""}`}>
{tab?.content && tab.content({ <TabContent
note, note={note}
hidden: !isActive, hidden={!isActive}
ntxId, ntxId={ntxId}
hoistedNoteId, hoistedNoteId={hoistedNoteId}
notePath, notePath={notePath}
noteContext, noteContext={noteContext}
componentId, componentId={componentId}
activate: useCallback(() => { activate={useCallback(() => {
setActiveTabIndex(tab.index) setActiveTabIndex(tab.index)
}, [setActiveTabIndex]) }, [setActiveTabIndex])}
})} />
</div> </div>
); );
})} })}