Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ptx
on Oct 23, 2021
|
parent
|
context
|
favorite
| on:
Hooks are the best thing to happen to React
So where the article says
loading // true setLoading(false) loading // false
they mean that it will become false in the next invocation of the render function, I hope?
dragonwriter
on Oct 23, 2021
[–]
That's exactly what the setter function returned by useState does, it sets the value returned the next time the corresponding useState is run for the same component (it is order based, which is why hooks must be run in a constant order.)
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: