From 5ee55ef3c0aae0df19714153717b1c66cebb2220 Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Sat, 25 Dec 2021 12:30:49 -0600 Subject: [PATCH] instance management and deactivation --- playground/counter.tsx | 3 ++- playground/main.tsx | 8 +++--- src.new/main.ts | 52 ++++++++++++++++++++++++++++++--------- src.new/renderer.ts | 55 ++++++++++++++++++++++++++++++++++++++---- 4 files changed, 97 insertions(+), 21 deletions(-) diff --git a/playground/counter.tsx b/playground/counter.tsx index 0235907..cb461c0 100644 --- a/playground/counter.tsx +++ b/playground/counter.tsx @@ -4,7 +4,7 @@ import { EmbedField } from "../src.new/embed/embed-field.js" import { EmbedTitle } from "../src.new/embed/embed-title.js" import { Embed } from "../src.new/embed/embed.js" -export function Counter() { +export function Counter(props: { onDeactivate: () => void }) { const [count, setCount] = React.useState(0) const [embedVisible, setEmbedVisible] = React.useState(false) @@ -32,6 +32,7 @@ export function Counter() { {!embedVisible && (