React-router: browserHistory with custom basename

Created on 8 Feb 2016  路  4Comments  路  Source: ReactTraining/react-router

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?

Most helpful comment

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

All 4 comments

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.

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

@zettadam Come help! :smile: #2933

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArthurRougier picture ArthurRougier  路  3Comments

wzup picture wzup  路  3Comments

imWildCat picture imWildCat  路  3Comments

andrewpillar picture andrewpillar  路  3Comments

Waquo picture Waquo  路  3Comments