Attempt to implement settings syncing

This commit is contained in:
ransurf 2021-10-10 21:08:13 -07:00
parent b53b8758ba
commit 9824d2ba31
10 changed files with 118 additions and 10 deletions

32
view.ts
View file

@ -1,32 +0,0 @@
import { ItemView,WorkspaceLeaf } from "obsidian";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { ReactView } from "./ReactView";
export const VIEW_TYPE_EXAMPLE = "example-view"
export class ExampleView extends ItemView {
constructor(leaf: WorkspaceLeaf) {
super(leaf)
}
getViewType() {
return VIEW_TYPE_EXAMPLE
}
getDisplayText() {
return "Example View"
}
async onOpen() {
ReactDOM.render(
React.createElement(ReactView),
this.containerEl.children[1]
)
}
async onClose(){
ReactDOM.unmountComponentAtNode(this.containerEl.children[1]);
}
}