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

145
Views
How to configure dynamic subpath for react app

I want to deploy my react app with subpath (subdirectory path) but I don't want to set the subdirectory/path name in react app as this subdirectory name may change in future.

How to make configuration at react app level as it can work for any subdirectory name at server side which will not be hardcoded at react app level and it will be as a subpath for the application url.

eg. https://www.dummyname.com/anysubpath

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can create a reusable HOC and handle the logic of the server data in that and pass it to the path property in react-router.

For a dynamic path (slug) use dynamic routes like below:

<Route path="/some-path/:slug" component={SomeComponent} />

For more details refer to React router dynamic routing

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!