mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 09:56:36 +01:00
refactor(react/ribbon): use custom method for injecting handlers
This commit is contained in:
@@ -538,4 +538,11 @@ export function useTooltip(elRef: RefObject<HTMLElement>, config: Partial<Toolti
|
||||
}, [ elRef ]);
|
||||
|
||||
return { showTooltip, hideTooltip };
|
||||
}
|
||||
|
||||
export function useLegacyImperativeHandlers(handlers: Record<string, Function>) {
|
||||
const parentComponent = useContext(ParentComponent);
|
||||
useEffect(() => {
|
||||
Object.assign(parentComponent as any, handlers);
|
||||
}, [ handlers ])
|
||||
}
|
||||
Reference in New Issue
Block a user