Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created January 4, 2024 07:01
Show Gist options
  • Save yusukebe/93189a7dbceffe0301dd101084d2b106 to your computer and use it in GitHub Desktop.
Save yusukebe/93189a7dbceffe0301dd101084d2b106 to your computer and use it in GitHub Desktop.
/** @jsxImportSource hono/jsx */
import './style.css'
import { Component, render } from './front'
class Counter extends Component {
count = 0
increment() {
this.count++
this.update()
}
render() {
return (
<div>
<div>Counter: {this.count}</div>
<button onClick={() => this.increment()}>Increment</button>
</div>
)
}
}
render(<Counter />, document.querySelector<HTMLElement>('#app')!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment