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

234
Views
Gatsby Link absolute path

By using Link component in Gatsby.js I will not be able to directed by clickin on a link to back to previous urls , e.g: I have this url site.com/article/id let's say I am in the id page , so in this case when I use Link I will not be able to go to site.com/article/id2 but instead I will be only be able to go site.com/article/id/article/id2 . How to fix this ?

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

0

You just need to add a slash (/) the beginning of the to prop:

<Link to={`/${someSlugVar}`} />Click me</Link>

Otherwise, it concatenates the new slug to the current one because of the relativity of the paths. In the end, it behaves like a normal anchor so the approach is exactly the same (your issue will also happen using a normal <a>).

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!