Skip to content

refactor: move to React Router data router - #303

Open
Tomahawk2191 wants to merge 4 commits into
chore/react-router-8from
refactor/data-router
Open

Tomahawk2191 wants to merge 4 commits into
chore/react-router-8from
refactor/data-router

Conversation

@Tomahawk2191

@Tomahawk2191 Tomahawk2191 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What was the ticket?

N/A

What did I do?

Part 3 of 5. Stack: #301 → #302 → #303 → #304 → #305. Review and merge in order.

Moves from <BrowserRouter> + useRoutes to a data router (createBrowserRouter + RouterProvider) defined in src/router.tsx.

  • Deletes App.tsx, ExternalRedirect and ScrollToTop. A Root layout route renders the <Outlet /> and <ScrollRestoration />, with RootError as the error element and RootHydrateFallback while the first loader runs.
  • Sanity short links are no longer turned into one route per link at runtime. A catch-all * route's loader looks up the path in Sanity and redirects if it matches; otherwise it renders the landing page. Matching ignores case and trailing slashes, and a failed Sanity lookup falls through to the landing page instead of erroring.
  • /about redirects to / from its loader.
  • ExpandedTeamsPage reads the team from useParams() (/teams-expanded/:team) instead of parsing window.location and nesting <Routes>.
  • e2e: the route smoke tests also assert no error alert is rendered.

How did I test it?

Ran bun run lint, bun run typecheck, oxfmt --check and bun run build on this branch; all pass. e2e and manual browser testing still to do.

Required checks:

  • Did you conduct a self-review?
  • Have you written unit or integration tests?

What could go wrong in the future? What parts of your code should the reviewer pay the most attention to?

  • The old /positions/:id route is dropped; only /positions/:categoryType/:index remains. Nothing in the app links to the old form, but any external links to it now land on the landing page.
  • Static routes always win over short links, so a Sanity short link with the same slug as a page (e.g. teams) will never redirect.

Additional Comments for the Reviewers

Screenshots

N/A, no visual changes intended.

@Tomahawk2191
Tomahawk2191 added this pull request to stack #306 November 14, 2026 19:23
@netlify

netlify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for generatenu-website ready!

Name Link
🔨 Latest commit 5888e08
🔍 Latest deploy log https://app.netlify.com/projects/generatenu-website/deploys/6af8c8c95a50ee27622cf736
😎 Deploy Preview https://deploy-preview-303--generatenu-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Tomahawk2191
Tomahawk2191 marked this pull request as ready for review November 14, 2026 20:27
@Tomahawk2191
Tomahawk2191 requested a review from a team as a code owner November 14, 2026 20:27

@aahiltn aahiltn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense given prev pr
cool

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants