1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-06 23:56:13 +02:00
Files
joplin/packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.ts
2024-04-05 12:16:49 +01:00

15 lines
588 B
TypeScript

import { useEffect } from 'react';
import PlatformImplementation from '../../../services/plugins/PlatformImplementation';
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export default function usePluginServiceRegistration(ref: any) {
useEffect(() => {
PlatformImplementation.instance().registerComponent('textEditor', ref);
return () => {
PlatformImplementation.instance().unregisterComponent('textEditor');
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);
}