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

118
Views
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 answers
Answer question

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 Report
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!