diff --git a/apps/dotcom/src/__snapshots__/routes.test.tsx.snap b/apps/dotcom/src/__snapshots__/routes.test.tsx.snap index 48a05ab57..4d6d55f9b 100644 --- a/apps/dotcom/src/__snapshots__/routes.test.tsx.snap +++ b/apps/dotcom/src/__snapshots__/routes.test.tsx.snap @@ -6,6 +6,10 @@ exports[`the_routes 1`] = ` "reactRouterPattern": "/", "vercelRouterPattern": "^//?$", }, + { + "reactRouterPattern": "/new", + "vercelRouterPattern": "^/new/?$", + }, { "reactRouterPattern": "/r", "vercelRouterPattern": "^/r/?$", diff --git a/apps/dotcom/src/routes.test.tsx b/apps/dotcom/src/routes.test.tsx index b3bc91671..a68dafb3a 100644 --- a/apps/dotcom/src/routes.test.tsx +++ b/apps/dotcom/src/routes.test.tsx @@ -111,6 +111,7 @@ test('all React routes match', () => { test("non-react routes don't match", () => { // lil smoke test for basic patterns expect('/').toMatchAny(allvercelRouterPatterns) + expect('/new').toMatchAny(allvercelRouterPatterns) expect('/r/whatever').toMatchAny(allvercelRouterPatterns) expect('/r/whatever/').toMatchAny(allvercelRouterPatterns) diff --git a/apps/dotcom/src/routes.tsx b/apps/dotcom/src/routes.tsx index fa4022c42..dc2ad3093 100644 --- a/apps/dotcom/src/routes.tsx +++ b/apps/dotcom/src/routes.tsx @@ -1,7 +1,6 @@ import { captureException } from '@sentry/react' -import { nanoid } from 'nanoid' import { useEffect } from 'react' -import { createRoutesFromElements, Outlet, redirect, Route, useRouteError } from 'react-router-dom' +import { createRoutesFromElements, Navigate, Outlet, Route, useRouteError } from 'react-router-dom' import { DefaultErrorFallback } from './components/DefaultErrorFallback/DefaultErrorFallback' import { ErrorPage } from './components/ErrorPage/ErrorPage' @@ -30,13 +29,8 @@ export const router = createRoutesFromElements( > }> import('./pages/root')} /> - { - const id = 'v2' + nanoid() - return redirect(`/r/${id}`) - }} - /> + } /> + } /> import('./pages/public-multiplayer')} /> import('./pages/history')} />