react-router icon indicating copy to clipboard operation
react-router copied to clipboard

browserHistory with custom basename

Open zettadam opened this issue 10 years ago • 4 comments

As I understand from the docs, history module is built into react-router. How would one use browserHistory with a custom basename?

Let's say I have a number of smaller, independent React apps deployed with their own paths, like http://somebigapp.com/app1/, http://somebigapp.com/app2/. Is there a way to pass an option to browserHistory where I could define basename for my apps, or does browserHistory assume / as the root path?

zettadam avatar Feb 08 '16 13:02 zettadam

Thanks for your question!

We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router.

Questions like yours deserve a purpose-built Q&A forum. Could you post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router

We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46.

taion avatar Feb 08 '16 14:02 taion

Hmm... perhaps improved documentation would solve this issue.

zettadam avatar Feb 08 '16 14:02 zettadam

@zettadam Come help! :smile: #2933

timdorr avatar Feb 08 '16 15:02 timdorr

So what is the canonical way of doing this? Creating a router and passing in the history? If so I've tried this so far with no luck.

chrisl8888 avatar Jul 12 '17 17:07 chrisl8888