A standard Todo application demonstrating the fundamental concepts of the framework.
- Class Components: Using
class extends Componentfor stateful containers. - useState Hook: Managing local component state for the list of todos and input fields.
- Event Handling: Capturing
onsubmit,oninput, andonclickevents natively. - Reactivity: Automatic UI updates when the state is modified via
setTodos. - List Rendering: Mapping over arrays and returning
htmltemplates.
The app is built as a single class component ToDoApp. It manages the orchestration of adding, toggling, and deleting tasks.
import { Component, html, useState, mount } from '../../index.js'