diff --git a/src/js/Components.js b/src/js/Components.js index 76c8d02..eef3b0b 100644 --- a/src/js/Components.js +++ b/src/js/Components.js @@ -9,13 +9,13 @@ const undoClass = "undo-game"; /** * Gets a component which represents the specified {@link game `game`}. * - * @param {import("./Game.js").Game} game + * @param {{game: import("./Game.js").Game }} game * The game represented in this app. * * @returns {NodeDescriptor} * The rendered node. */ -export function App(game) +export function App({ game }) { return [ "div", @@ -91,6 +91,7 @@ export function App(game) */ export function Board({ board }) { + console.log(board); let fields = board.flatMap((row) => row); return [ diff --git a/src/js/Game.js b/src/js/Game.js index 85cc48a..8fc29f4 100644 --- a/src/js/Game.js +++ b/src/js/Game.js @@ -1,6 +1,6 @@ import { App } from "./Components.js"; import { State } from "./State.js"; -import { SuiWeb } from "./SuiWeb.js"; +import { render } from "./SuiWeb.js"; /** * Represents a game. @@ -192,7 +192,7 @@ export class Game { let container = document.getElementById(this.id); container.innerHTML = ""; - SuiWeb.render([App, this], container); + render([App, { game: this }], container); } /**