frejs / fre

:ghost: Tiny Concurrent UI library with Fiber.

Home Page:https://fre.deno.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useState不支持传函数吗

xilixjd opened this issue · comments

commented

`function Counter() {
const [state, setState] = useState(1)
return (
<h1 onClick={() => setState(c => c + 1)}>
Count: {state}

)
}
const element =

render(element, document.body)
`

setState() 里面参数不支持函数吗

之前不小心删掉了,现在好了