Skip to content

chore: upgrade react-router-dom v5 to v6 in examples#402

Closed
kparkinson-ld wants to merge 1 commit into
mainfrom
devin/1780948546-upgrade-react-router-dom-v6
Closed

chore: upgrade react-router-dom v5 to v6 in examples#402
kparkinson-ld wants to merge 1 commit into
mainfrom
devin/1780948546-upgrade-react-router-dom-v6

Conversation

@kparkinson-ld

@kparkinson-ld kparkinson-ld commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Resolves Dependabot alerts #228, #227 (path-to-regexp ReDoS vulnerability).

Describe the solution you've provided

Upgrades react-router-dom from v5 to v6 in both example apps (examples/async-provider, examples/hoc), migrating the router API:

  • SwitchRoutes
  • <Route component={X}><Route element={<X />}>
  • <Redirect><Navigate replace>
  • StaticRouter import moved from react-router-dom to react-router-dom/server
  • Removed context prop from StaticRouter (dropped in v6)

This eliminates the transitive dependency on path-to-regexp@1.x (vulnerable to ReDoS).

Additional context

The async-provider example still has one path-to-regexp@1.9.0 from webpack-servekoa-route, which will be addressed separately in a follow-up PR removing universal-hot-reload and webpack-serve.

Link to Devin session: https://app.devin.ai/sessions/381e0dd095a446e49ba0e8a9c9022c0c
Requested by: @kparkinson-ld


Note

Low Risk
Example-app-only dependency and routing API changes with no impact on the published SDK or production services.

Overview
Upgrades react-router-dom from v5 to ^6.0.0 in the async-provider example and updates routing to the v6 API.

In app.js, Switch is replaced with Routes, routes use element={<Component />} instead of component={Component}, and the /home redirect uses Navigate with replace instead of Redirect. This aligns the sample app with React Router 6 and removes the vulnerable path-to-regexp@1.x chain that came with v5 (Dependabot ReDoS alerts).

Reviewed by Cursor Bugbot for commit b3a22e7. Bugbot is set up for automated code reviews on this repo. Configure here.

Migrate both example apps from react-router-dom v5 to v6:
- Switch -> Routes
- Route component={X} -> Route element={<X />}
- Redirect -> Navigate
- StaticRouter moved to react-router-dom/server
- Remove context prop from StaticRouter (removed in v6)

Resolves path-to-regexp Dependabot alerts (#228, #227) by removing
the transitive dependency on the vulnerable path-to-regexp 1.x.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@kparkinson-ld kparkinson-ld marked this pull request as ready for review June 8, 2026 20:04
@kparkinson-ld kparkinson-ld requested a review from a team as a code owner June 8, 2026 20:04
@devin-ai-integration devin-ai-integration Bot changed the title fix: upgrade react-router-dom v5 to v6 in examples chore: upgrade react-router-dom v5 to v6 in examples Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant