add re-render method

This commit is contained in:
MapleLeaf
2021-12-09 03:01:13 -06:00
parent ade2464aaf
commit a7b1221524
2 changed files with 18 additions and 6 deletions

View File

@@ -10,6 +10,9 @@ export function render(content: string, target: ReacordRenderTarget) {
const containerId = reconciler.createContainer(container, 0, false, null)
reconciler.updateContainer(content, containerId)
return {
rerender: (newContent: string) => {
reconciler.updateContainer(newContent, containerId)
},
destroy: () => {
reconciler.updateContainer(null, containerId)
},