Custom react hooks vs services
Stephen Chiang
Posted on July 10, 2019
I'm having a tough time explaining the difference between a custom react hook and a service.
It's easy to see the utility of the built in ones, but what about custom hooks?
with a regular service, I can :
- import it to any component, provide it's functions and or state.
- call or make use of react hooks.
When would you write a custom hook and when would you opt for a service?
What can you do with a custom hook that you can't do with a service?
💖 💪 🙅 🚩
Stephen Chiang
Posted on July 10, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
discuss Naming conventions for easy identification of StyledComponent and ReactComponent
October 15, 2021