Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate react-router from v5 to v6 #608

Open
4 tasks
leventebalogh opened this issue Feb 20, 2024 · 0 comments · May be fixed by #979
Open
4 tasks

Migrate react-router from v5 to v6 #608

leventebalogh opened this issue Feb 20, 2024 · 0 comments · May be fixed by #979

Comments

@leventebalogh
Copy link
Contributor

Why?

Grafana core allows plugins to start using the v6 version of react-router, and hopefully we will deprecate using v5 in plugins this year. @grafana/scenes is used by internal app plugins, which means that before migrating those we need to have a version of the scenes package that supports versions 6.x.x as well.

How?

For the scenes-app follow our migration guide using create-plugin, and for scenes rely on the official react-router v5->v6 migration guide.

Some of the things that need too be changed: (list is not complete)

  • SceneApp: Use <Routes> instead of <Switch>
  • SceneApp: Stop using the render={} prop in Route components, use the element={} prop instead and the useParams() hook
  • SceneAppPage: stop using the render={} prop and the <Switch> component
  • Routes: stop using the <Switch> component
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 a pull request may close this issue.

1 participant