From c9c1b78ed805371615d3ca8b54c86da9a35db8ce Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 13 Apr 2021 11:37:51 -0500 Subject: implement basic user input and button styling --- main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.js') diff --git a/main.js b/main.js index 0ca765b..72c97a4 100644 --- a/main.js +++ b/main.js @@ -2,6 +2,16 @@ const h = Inferno.h; +function useState(initial) { + let state = initial; + let setState = (value) => { + state = value; + render(); + } + return [state, setState]; +} + + function render() { Inferno.render( -- cgit v1.2.1