-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add support for React router v7 #10440
base: mui-6
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,6 @@ | |||
import * as React from 'react'; | |||
import Button from '@mui/material/Button'; | |||
import { Link } from 'react-router-dom'; | |||
import { Link } from 'react-router'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to be only available from react-router-dom
so it "proves" we use v7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a non breaking change way to migrate to react-router v7 is always use react-router-dom package inside react-admin. It is a re-export of react-router https://reactrouter.com/start/changelog#package-restructuring
Then people using react-router v6 won't be affected by such things like import { Link } from 'react-router(v6)'; that does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see it is for demo project, not package itself. I misunderstood the previous message.
Problem
react-router v7 is out
Solution
Follow #10437 and #10439
Add support for React router v7
react-admin packages will still use v6 in their devDependencies to ensure we don't use v7 only features inadvertently.
The tutorial and e-commerce demo will use v7 so that we have an easy way to test v7
How To Test
Works with v6
npm init react-admin react-admin-router
npm add react-router@6 react-router-dom@6
react-admin-router/node_modules
directoryWorks with v7
^7.0.0
npm install
Additional Checks
master
for a bugfix, ornext
for a feature