v6.4.0-pre.2
DataHashRouter

DataHashRouter

This router is useful if you are unable to configure your web server to direct all traffic to your React Router application. Instead of using normal URLs, it will use the hash (#) portion of the URL to manage the "application URL".

Using hash URLs is not recommended.

Other than that, it is functionally the same as DataBrowserRouter.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { DataHashRouter } from "react-router-dom";
import Root from "./routes/root";

ReactDOM.render(
  <DataHashRouter>
    <Route element={<Root />} loader={Root.loader}>
      <Route path="team" element={<Team />} loader={Team.loader}>
    </Route>
  </DataHashRouter>,
  root
);

Type Declaration

declare function DataHashRouter(
  props: DataBrowserRouterProps
): React.ReactElement;

export interface DataHashRouterProps {
  children?: React.ReactNode;
  hydrationData?: HydrationState;
  fallbackElement?: React.ReactElement;
  window?: Window;
}
Docs and examples CC 4.0