diff options
author | sanine-a <sanine.not@pm.me> | 2021-04-12 17:40:33 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2021-04-12 17:40:33 -0500 |
commit | bc594a2d3839d1d0a3cc76eed23ec8535c72f6bf (patch) | |
tree | e63cc0faf2d756f5c0d92a14e2ddca59e3a52d39 /App.js | |
parent | 82573dc615710c13d988ef27823d24839df100ab (diff) |
begin refactor to use Inferno
Diffstat (limited to 'App.js')
-rw-r--r-- | App.js | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -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} + ), + ] + ); +} |