-
Notifications
You must be signed in to change notification settings - Fork 19
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
App plugin: Update to react-router v6 #713
Comments
Doing this depends on scenes also moving to v6 => grafana/scenes#608 |
@grafanaman has done some of this work, but have not yet jumped to v6. |
I think we are still waiting on grafana/scenes#608 before we do the update. |
We're using
When this is merged, we could officially bundle with |
I've updated the issue description to reflect what has been done and that we're waiting for grafana/scenes#608 to be merged before we do anything else. |
Starting from Grafana 10, plugins can start using the v6 of react-router. Overall, react-router v6 aims to simplify route configuration and provide a more flexible and intuitive API for developers.
Why?
We are going to deprecate using react-router v5 in plugins from Grafana 11, and we would like to make sure our internal app plugins are using the v6 version by the time we finish migrating Grafana core itself.
How?
We have created a migration guide for plugins (please see the links below), and also don't hesitate to reach out in
#grafana-plugins-platform
in Slack in case you have any questions.Install
react-router-dom-v5-compat
Use
v6
<Routes />
and<Route />
Use
v6
hooks instead ofv5
hooksWait for scenes
Change dependency from
react-router-dom-v5-compat
toreact-router-dom@6
Update
.cprc.json
("useReactRouterV6": true
)Update test setup for
render
(perhaps we still need to use the Compat setup?)How to migrate a Grafana app plugin to react-router v6
Official React Router v5 to v6 migration guide
Community topic
The text was updated successfully, but these errors were encountered: