Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda