mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 18:36:30 +01:00
feat(react): basic integration for basic widget & modal
This commit is contained in:
14
apps/client/src/widgets/react/ReactBasicWidget.ts
Normal file
14
apps/client/src/widgets/react/ReactBasicWidget.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { JSX, render } from "preact";
|
||||
import BasicWidget from "../basic_widget.js";
|
||||
|
||||
export default abstract class ReactBasicWidget extends BasicWidget {
|
||||
|
||||
abstract get component(): JSX.Element;
|
||||
|
||||
doRender() {
|
||||
const renderContainer = new DocumentFragment();
|
||||
render(this.component, renderContainer);
|
||||
this.$widget = $(renderContainer.firstChild as HTMLElement);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user