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;
}
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>
);
})}