Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
is it okay to use a custom Hook for every functionality? or should I keep the use of hooks in my project to a minimum?

as of now, I am making a ReactJs web application that is a chatroom using Firebase i have created a dedicated hook for each functionality for example, there are hooks like

  • useSignup
  • useLogin
  • useLogout
  • useAuth
  • useCollection
  • useSendMsg

that return a function that performs the tasks indicated by the name of those custom hooks, using hooks for these look attractive to be because it allows me to return state checkers like isLoading and isError along with their functions, those are simple useStates that i set during the process to manage the loading and error states.

there are other hooks I create that are related to context, i like to call contexts inside hooks because that way the code looks a lot more elegant and de-cluttered for example i created hooks like

  • useAuthContext
  • useCurrentRoomContext

I am not over-doing it am I? I was curious about were do I draw the line? is it healthy to use Hooks like this? should I change my Programming approach?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!