Skip to content

Commit 9e0610d

Browse files
committed
Bump version to 0.0.28 in package.json and update usage instructions in newstack.md
1 parent 3de149c commit 9e0610d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/create-newstack-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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"],

packages/create-newstack-app/src/newstack.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)