File size: 664 Bytes
1dbc34b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import { createRouter, createMemoryHistory, createBrowserHistory } from '@tanstack/react-router';
import { routeTree } from '../routeTree.gen';
// Use browser history in web mode (for e2e tests and dev), memory history in Electron
const isElectron = typeof window !== 'undefined' && window.electronAPI !== undefined;
const BOARD_ROUTE_PATH = '/board';
const history = isElectron
? createMemoryHistory({ initialEntries: [BOARD_ROUTE_PATH] })
: createBrowserHistory();
export const router = createRouter({
routeTree,
defaultPendingMinMs: 0,
history,
});
declare module '@tanstack/react-router' {
interface Register {
router: typeof router;
}
}
|