mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
14 lines
324 B
TypeScript
14 lines
324 B
TypeScript
import React from 'react'
|
|
function main(props) {
|
|
const [count, setCount] = React.useState(1)
|
|
const onClick = React.useCallback(() => {
|
|
setCount(count + 1)
|
|
console.log(count)
|
|
}, [])
|
|
return (
|
|
<button onClick= { onClick } > { count } </button>
|
|
)
|
|
}
|
|
|
|
|