Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda