This Error is in the docs website.
Go to React Router's This page
Click on any link in there such as Hooks, useParams etc.
Should scroll down to the heading level clicked.
Takes to the homepage.
Anchor tags of website are still being made from react-router/docs folder, and they have /react-router/ in front of them.
Example Link from prod site: https://reactrouter.com/react-router/web/api/Hooks/usehistory.
I think react-router's website used to be react-training.com, and the links are the same.
I'd love to open a PR and contribute, But i seriously have no idea where those links are being built.
There is a <DelegateMarkdownLinks> component, which removes the basepath from all the markdown links and converts them to proper links. So this should all be fixed by correctly setting the basepath to react-router, which is added into the <base> tag during compile time by webpack. Webpack takes it from the webpack.config.js.
https://github.com/ReactTraining/react-router/blob/f6d98ecd98f97e729d09f17dff8e0dc4c92d2f5b/website/webpack.config.js#L19
Unfortunately I can't build the site locally for some reason, to test if this really fixes it, so I am not submitting an untested PR.
馃挴 Would be nice if those links worked!
Currently working on this one. The links work as expected locally, not sure why.
@pReya Changing the publicPath is giving me a CORB error with no webpage displayed. However I noticed when changing the publicPath to https://reactrouter.com/ the page icons correctly display even though the page doesn't load, which leads me to think it would work in production.
I changed the publicPath to process.env.NODE_ENV === 'production' ? 'https://reactrouter.com' : '/' but I don't know how to test if this will actually work. Does anyone know how to test this?
I love yall, and react router does good work, but damn if all internal links on react router's docs being broken due to a react router error isn't a very funny joke
Looked into this a little more. It seems that somebody already fixed the code (https://github.com/ReactTraining/react-router/issues/7540), but since then the page hasn't been re-reployed, yet. So I think all it would take to fix this is have someone with the proper rights kick off a new deployment. Is this correct @timdorr? Who has the rights to deploy the page? @ryanflorence @mjackson maybe you can help?
I was finally able to get some time to update the website branch. This appears to be fixed. I'll close this out, but let me know if I missed something!
Most helpful comment
I love yall, and react router does good work, but damn if all internal links on react router's docs being broken due to a react router error isn't a very funny joke