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

feat: upgrade react-router to v6 in dashboard #3007

Merged
merged 10 commits into from
Jun 13, 2021

Conversation

nuanyang233
Copy link
Collaborator

closes #2989

@nuanyang233
Copy link
Collaborator Author

Comment on lines 23 to 28
const renderLink = useMemo(
() =>
forwardRef<HTMLAnchorElement | null, Omit<LinkProps, 'to'>>((linkProps, ref) => (
<Link to={to} ref={ref} {...linkProps} />
)),
[to],
Copy link
Member

Choose a reason for hiding this comment

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

Hmm this part is strange to me... Why not define a new Link that internally renames component props (from mui) to as props (to react-route)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Link does not have as props in v6

@nuanyang233
Copy link
Collaborator Author

nuanyang233 commented Apr 25, 2021

It looks like react-router doesn't support <Link as={component} /> for now. Close the pr first until the problem is solved.

remix-run/react-router#7832

@Jack-Works Jack-Works reopened this Apr 26, 2021
@Jack-Works Jack-Works marked this pull request as draft April 26, 2021 02:29
@Jack-Works
Copy link
Member

reopened but converted to draft.

@Jack-Works
Copy link
Member

Will you continue on this before we have more routes? @nuanyang233

@nuanyang233
Copy link
Collaborator Author

Will you continue on this before we have more routes? @nuanyang233

hmm, it looks like react-router doesn't solve the previously mentioned problem. I'll keep trying to replace it.

@nuanyang233
Copy link
Collaborator Author

nuanyang233 commented Jun 11, 2021

Sorry, I re-tested and the problem is not that react-router is missing as prop. Rather, it's a type issue with Material-UI When , this is the reason:

image

However, Material-UI provides <ListItemButton /> in version 36 to solve this problem.
mui/material-ui#26446

But they missing export it in version 36... mui/material-ui#26660

maybe we need to wait for version 38. 😂

cc @Jack-Works

@Jack-Works
Copy link
Member

We have patch-package available. You can patch material-ui to make things work. We're not going to upgrade to v35 recently because v35 needs to rewrite the import of makeStyles and I don't have the time budget for that.

@nuanyang233 nuanyang233 force-pushed the feature/upgrade-react-router branch from add7a93 to 02eb77e Compare June 11, 2021 19:12
@Jack-Works
Copy link
Member

@nuanyang233 I see the patch file is a little big. Is all that content necessary? Is it possible to do via a smaller (minimal) patch? That will be easier when we're going to upgrade.

@Jack-Works Jack-Works marked this pull request as ready for review June 13, 2021 02:32
@auto-assign auto-assign bot requested a review from Jack-Works June 13, 2021 02:32
@Jack-Works Jack-Works merged commit 77521bb into master Jun 13, 2021
@Jack-Works Jack-Works deleted the feature/upgrade-react-router branch June 13, 2021 02:38
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 this pull request may close these issues.

[Demand] Upgrade react-router to v6 in dashboard
2 participants