Aggiunta pagina per appunti condivisi con setup minimale di Preact

This commit is contained in:
2022-08-27 22:58:13 +02:00
parent 5337849bc7
commit 6e90f8c32f
7 changed files with 465 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
import { render } from 'preact'
import { useState } from 'preact/hooks'
const Counter = ({}) => {
const [value, setValue] = useState(0)
const increment = () => {
setValue(value => value + 1)
}
return (
<p>
Counter: {value} <button onClick={increment}>+</button>
</p>
)
}
render(
<>
<h1>Preact is Working!</h1>
<Counter />
</>,
document.querySelector('#app')
)