Skip to content
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

Why the preference for browserHistory over hashHistory? #2978

Closed
clintharris opened this issue Jan 26, 2016 · 1 comment
Closed

Why the preference for browserHistory over hashHistory? #2978

clintharris opened this issue Jan 26, 2016 · 1 comment

Comments

@clintharris
Copy link

I'm relatively new to React; apologies if this is a really naive question.

What are the technical advantages to createHistory that make it preferable over hashHistory? For example, is there a major performance/efficiency boost from it using the History API?

The docs state that browserHistory is recommended, even though this comes at the cost of the additional server config and needing to hard-code or configure your base URL for different servers via basename.

hashHistory "just works", however, regardless of the base URL from which the files are served. No server config needed. Bundle your app, host it from any URL/path on a server, good to go.

It might be good if the docs went a bit further in explaining why it browserHistory is recommended even though it involves more complexity.

@taion
Copy link
Contributor

taion commented Jan 26, 2016

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 taion closed this as completed Jan 26, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants