New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document that basename should only be a relative URL #590
Comments
While it doesn't use the word "relative", the |
Ahh, ok thank you. I wasn't looking at the react-router docs because I'm not using react-router, just the history package. So, I was only looking at the README here - https://github.com/ReactTraining/history#using-a-base-url I guess most users are just using react-router so I'll just close this now. Thanks again! |
Also, the readme itself does kinda say it - 'If all the URLs in your app are relative to some other "base" URL, ' LMAO |
Sorry, I didn't actually realize this was the |
Since there is no standard definition for what a basename is within the browser environment, I wasn't sure if I could pass an absolute URL or only a relative URL as the basename option. There is a base href which can be an absolute or relative url. There is also the Unix basename, which has output very similar to a relative url.
I wanted to find an answer without digging through the code if possible. This comment about prefixing basenames with
/
finally confirmed to me that basename should probably only be a relative URL.Of course the examples you show only use relative URLs, but I wanted to be sure.
So, I think you should point that out in the documentation. If you want a pull request for that I'll be glad to do it, the change should only be a few bytes.
Thanks!
The text was updated successfully, but these errors were encountered: