|
|
|
|
|
by lj3
2689 days ago
|
|
> as multiple independent components might want to share state or listen to shared events, etc. If you recall, I said... > Hooks are great because it keeps the state local, but it can be re-used across components if we need to. The use case you just defined is exactly why hooks were created. |
|
Legit question because I don't know hooks very well. To my understanding, hooks are just syntactic sugar to use and update local state in a function component. How does that help you share state between components?