Double base path when using push with basename

Viewed 870

I've come across an issue which I've been trying to figure whether I'm just doing something wrong or whether it's an actual bug. After a lot of searching, I still can't figure out if I'm doing something wrong or if I've found an actual problem.

Part of the reason as to why I'm so confused is also because I found the intersection between react-router and history a bit confusing. It took me a while to figure out exactly how to use history's enhancer functions with react-router and I still think the issue might lay there.

I have a test case here:

And the problem is:

Some additional detail:

  • If I use the <base> tag instead of the useBasename enhancer this works fine. However, given that I have a slightly different setup for dev and production, using an environment variable to define the basepath would be more helpful, rather than manipulating the <base> tag at build time.
  • The sample app I uploaded is a minimal subset of the app I'm working on. I removed everything else that didn't matter.
  • The issue does not occur when running this locally with a basepath set to an empty string.
1 Answers
Related