File tree Expand file tree Collapse file tree
packages/create-newstack-app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " create-newstack-app" ,
3- "version" : " 0.0.27 " ,
3+ "version" : " 0.0.28 " ,
44 "description" : " Scaffold a new Newstack application" ,
55 "type" : " module" ,
66 "files" : [" dist" ],
Original file line number Diff line number Diff line change @@ -453,8 +453,6 @@ Newstack can be used directly in a browser without any build step via Babel Stan
453453 import Newstack, { NewstackClient } from "https://cdn.jsdelivr.net/npm/@moureau/newstack/dist/index.min.js";
454454 import { h , Fragment } from "https://cdn.jsdelivr.net/npm/@moureau/newstack/dist/jsx-shim.js";
455455
456- NewstackClient.init();
457-
458456 class App extends Newstack {
459457 value = " " ;
460458
@@ -468,7 +466,12 @@ Newstack can be used directly in a browser without any build step via Babel Stan
468466 }
469467 }
470468
471- window.mount(App, document.body);
469+ const root =
470+ document.querySelector("#app") ??
471+ document.body.appendChild(Object.assign(document.createElement("div"), { id : " app" } ));
472+
473+ const newstack = NewstackClient.init();
474+ newstack.mount(App, root);
472475 </script >
473476 </body >
474477</html >
You can’t perform that action at this time.
0 commit comments