summaryrefslogtreecommitdiff
path: root/App.js
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2021-04-12 17:40:33 -0500
committersanine-a <sanine.not@pm.me>2021-04-12 17:40:33 -0500
commitbc594a2d3839d1d0a3cc76eed23ec8535c72f6bf (patch)
treee63cc0faf2d756f5c0d92a14e2ddca59e3a52d39 /App.js
parent82573dc615710c13d988ef27823d24839df100ab (diff)
begin refactor to use Inferno
Diffstat (limited to 'App.js')
-rw-r--r--App.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/App.js b/App.js
new file mode 100644
index 0000000..ebfcae3
--- /dev/null
+++ b/App.js
@@ -0,0 +1,36 @@
+let state = {};
+let internalState = {};
+
+state.currentChar = '你';
+
+function setState(key, value)
+{
+ state[key] = value;
+ render();
+}
+
+
+const CurrentCharacter = function({character})
+{
+ return h(
+ 'h1',
+ { onClick: () => setState('currentChar', '我') },
+ character
+ );
+}
+
+
+const App = function()
+{
+ const { currentChar } = state;
+
+ return h(
+ 'div', {},
+ [
+ h(
+ CurrentCharacter,
+ {character: currentChar}
+ ),
+ ]
+ );
+}