Short answer.... some devs think hash routing produces "ugly" URLs... but no, really, hash routing serves a purpose where perhaps the server environment isn't setup to handle current HTML or otherwise needs to handle all page requests at a static URL.
This is about as much explanation as the docs provide.
HashRouter
<HashRouter>
is for use in web browsers when the URL should not (or
cannot) be sent to the server for some reason. This may happen in some
shared hosting scenarios where you do not have full control over the
server. In these situations, <HashRouter>
makes it possible to store
the current location in the hash portion of the current URL, so it is
never sent to the server.
It's basically, "Only use hash routing if that's what you need and you know what you are doing." I think it's generally the case that if you don't really know what you are doing or need that you really just need the BrowserRouter
.
Are there any major disadvantages? Does it break any api somehow?
I wouldn't say there are major disadvantages to using the HashRouter
, it just serves a different purpose, like the NativeRouter
on native mobile devices, or the MemoryRouter
in node environments. I don't know if you are asking if it breaks any specific APIs using the HashRouter
, but I'm inclined to say no, it still works with redux, fetch/axios, etc... and just about anything else I can think of I've used along with hash routing.