Skip to content

Comments

chore: migrate react router to v7#1579

Merged
VikaCep merged 1 commit intomainfrom
chore/migrate-react-router-v7
Feb 20, 2026
Merged

chore: migrate react router to v7#1579
VikaCep merged 1 commit intomainfrom
chore/migrate-react-router-v7

Conversation

@VikaCep
Copy link
Contributor

@VikaCep VikaCep commented Feb 5, 2026

Migrate react router v7

Summary

This PR migrates from React Router v6 to v7, building on top of the v6 migration branch (chore/migrate-react-router-v6).

React Router v7 is largely backward compatible with v6, with the main change being the package consolidation from react-router-dom to react-router.

Changes

  • Package upgrade: react-router-dom@6.27.0react-router@7.13.0
  • Import updates: All imports changed from 'react-router-dom' to 'react-router'
  • Navigate fix: Updated <Navigate> components to use absolute paths via getRoute() to prevent infinite redirect loops (v7 resolves relative paths differently than v6)

Notes

It's not required to perform this migration just yet, but given that v7 is the actively maintained version with no breaking API changes, and other Grafana plugins (like logs-drilldown) have already adopted it, upgrading now is a low-risk way to stay aligned with the ecosystem and avoid future technical debt.

@VikaCep VikaCep requested a review from ckbedwell February 5, 2026 15:44
@VikaCep VikaCep self-assigned this Feb 5, 2026
@VikaCep VikaCep requested review from a team as code owners February 5, 2026 15:44
@github-actions github-actions bot added the chore A miscellaneous change added to the application. label Feb 5, 2026
@VikaCep VikaCep force-pushed the chore/migrate-react-router-v7 branch from 831262c to 478602e Compare February 5, 2026 15:52
@VikaCep VikaCep changed the title chore: migrate react router v7 chore: migrate react router to v7 Feb 5, 2026
Base automatically changed from chore/migrate-react-router-v6 to main February 13, 2026 17:12
- Upgrade react-router-dom@6.27.0 to react-router@7.13.0
- Update all imports from 'react-router-dom' to 'react-router'
- Fix Navigate components to use absolute paths via getRoute()
  to prevent infinite redirect loops (v7 resolves relative paths
  differently than v6)
- Add navigation guard in test mock to prevent same-location
  navigation loops
@VikaCep VikaCep force-pushed the chore/migrate-react-router-v7 branch from 478602e to 8fc1fee Compare February 18, 2026 16:59
@github-actions
Copy link

TruffleHog Scan Results

No secrets detected in this PR.

@github-actions
Copy link

Script size changes

Name +/- Main This PR Outcome
[942.js] New file - 2,134.82 kB
[361.js] = 801.07 kB 801.11 kB
[datasource/module.js] = 25.25 kB 25.25 kB
[692.js] = 20.64 kB 20.64 kB
[663.js] = 5.83 kB 5.83 kB
[module.js] = 4.59 kB 4.59 kB
[156.js] = 1.90 kB 1.90 kB
[217.js] Deleted file 2,190.00 kB -

Totals

Name +/- Main This PR Outcome
[Scripts] -1.81% 3,049.27 kB 2,994.13 kB
[Non-script Assets] = 2,679.89 kB 2,679.89 kB
[All] -0.96% 5,729.16 kB 5,674.02 kB

Generated by 🚫 dangerJS against 8fc1fee

Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

LGTM!

@VikaCep VikaCep merged commit 82d6af9 into main Feb 20, 2026
37 checks passed
@VikaCep VikaCep deleted the chore/migrate-react-router-v7 branch February 20, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A miscellaneous change added to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants