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

120
Vistas
Understanding featured based folder structure for React projects

I'm using a featured based React architecture documentation and I get the general concept behind it, but I have some questions about it:

  1. What If I need to use code of one feature in other feature? this can be allowed? according to featured separation concept each feature must be isolated with its own modules/code.

  2. How can I enable communication between features?

One posible situation can be, useAuth hook, this going to handle authentication proccess in the app with things like login, logout and other methods, so its neccesary to this functionality can be accesible by any feature, then I could have two possible places which I can place this hook:

  1. Create a folder called hooks, where global hooks going to live, and there put the useAuth hook.

  2. Create a feature called authentication with a hook folder on it and put there our useAuth hook but, How can I make this hook visible to the other features?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For your first question,

What If I need to use code of one feature in other feature? this can be allowed? according to featured separation concept each feature must be isolated with its own modules/code.

You could just put the useAuth hook in the common/ folder or maybe if you have too many, use your idea of another folder.

How can I enable communication between features?

With the standard React Context API, you can create a file that makes a context, and import the context when needed. For more advanced state management you will need a library like MobX.

about 4 years ago · Juan Pablo Isaza Denunciar
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