refactor(react/ribbon): use custom method for injecting handlers

This commit is contained in:
Elian Doran
2025-08-23 20:44:03 +03:00
parent 82914fc2aa
commit a934760960
2 changed files with 31 additions and 27 deletions

View File

@@ -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 ])
}