2020-10-09 19:35:46 +02:00
|
|
|
import { useEffect } from 'react';
|
|
|
|
import PlatformImplementation from '../../../services/plugins/PlatformImplementation';
|
|
|
|
|
2024-04-05 13:16:49 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2020-11-12 21:13:28 +02:00
|
|
|
export default function usePluginServiceRegistration(ref: any) {
|
2020-10-09 19:35:46 +02:00
|
|
|
useEffect(() => {
|
|
|
|
PlatformImplementation.instance().registerComponent('textEditor', ref);
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
PlatformImplementation.instance().unregisterComponent('textEditor');
|
|
|
|
};
|
2022-08-19 13:10:04 +02:00
|
|
|
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
2020-10-09 19:35:46 +02:00
|
|
|
}, []);
|
|
|
|
}
|