added backup source for future ref

This commit is contained in:
2022-01-14 18:23:19 +00:00
parent 33e18d8f2a
commit 10c6ddb61a
12 changed files with 210 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import react.ReactMacro.jsx;
import Webpack.*;
import Root;
class App {
static var STYLES = require('./App.css');
static public function main() {
new App();
}
public function new() {
var root = createRoot();
var rootComponent = react.ReactDOM.render(jsx('
<Root/>
'), root);
#if debug
ReactHMR.autoRefresh(rootComponent);
#end
}
function createRoot() {
var current = js.Browser.document.getElementById('root');
if (current != null) return current;
current = Dom.div();
current.id = 'root';
Dom.body().appendChild(current);
return current;
}
}