1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/packages/app-desktop/gui/NoteEditor/utils/usePluginServiceRegistration.ts
2022-08-19 12:10:04 +01:00

14 lines
489 B
TypeScript

import { useEffect } from 'react';
import PlatformImplementation from '../../../services/plugins/PlatformImplementation';
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
}, []);
}