Closed ZhangDaZongWei closed 4 years ago
sorry, My English is not good, I want to ask a question:
const UseSt8Example: React.FC<any> = () => { console.log('running---1') const count = useSt8(0) return ( <> <span>{count()}</span> <button onClick={() => count(c => c+1)}>add</button> </> ) }
when click button, how count() to change ?
button
count()
I don't get the question, that is what it does by default: https://codesandbox.io/s/q9q7yrxjkj
sorry, My English is not good, I want to ask a question:
when click
button
, howcount()
to change ?