Y
Hacker News
new
|
ask
|
show
|
jobs
by
8note
628 days ago
Ive probably been doing it wrong, but isn't useEffect needed to make any hooks work? useState does nothing most of the time
2 comments
recursive
628 days ago
No. `useState` returns the value of the state, and a setter. It's not about side effects, it's about the value. The returned setter triggers a re-render. That's not nothing.
link
kaoD
628 days ago
https://react.dev/learn/you-might-not-need-an-effect
link