mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
18 lines
467 B
TypeScript
18 lines
467 B
TypeScript
import { runInAction } from 'mobx';
|
|
import renderer from './renderer';
|
|
|
|
if (typeof window !== 'undefined') {
|
|
(window as any).SimulatorRenderer = renderer;
|
|
}
|
|
|
|
window.addEventListener('beforeunload', () => {
|
|
runInAction(() => {
|
|
(window as any).LCSimulatorHost = null;
|
|
renderer.dispose?.();
|
|
(window as any).SimulatorRenderer = null;
|
|
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app'));
|
|
});
|
|
});
|
|
|
|
export default renderer;
|