Skip to content

Commit

Permalink
hashrouter doesn't need a basename?
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Jun 20, 2023
1 parent 387a992 commit 6e85b0a
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,21 @@ async function conversationLoader({ params }: any) {
return { conversation };
}

const router = createHashRouter(
[
{
path: "*",
element: <App />,
},
{
path: "c/:conversationTopic",
element: <ConversationViewWithLoader />,
loader: conversationLoader,
},
{
path: "new",
element: <NewConversationView />,
},
],
{ basename: import.meta.env.DEV ? "" : "/xmtp-quickstart-react/" }
);
const router = createHashRouter([
{
path: "*",
element: <App />,
},
{
path: "c/:conversationTopic",
element: <ConversationViewWithLoader />,
loader: conversationLoader,
},
{
path: "new",
element: <NewConversationView />,
},
]);

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
Expand Down

0 comments on commit 6e85b0a

Please sign in to comment.