[link] What's the recommended way of using MUI Link with Next.js Link?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Current behavior 😯
Currently the way its suggested to integrate MUI Link to NextJS Link component is use the example in
https://github.com/mui-org/material-ui/blob/ec5df5f94f472628103eb1cfbecccc6afc2658bd/examples/nextjs-with-typescript/src/Link.tsx
Expected behavior 🤔
https://stackoverflow.com/a/66228870
This basically, gives the same functionality, without the overhead.
import NextLink from 'next/link'
import MuiLink from '@material-ui/core';
<NextLink href="/" passHref>
<MuiLink>MyLink</MuiLink>
</NextLink>
Steps to reproduce 🕹
https://stackoverflow.com/a/66228870
vs
https://github.com/mui-org/material-ui/blob/ec5df5f94f472628103eb1cfbecccc6afc2658bd/examples/nextjs-with-typescript/src/Link.tsx
Context 🔦
What's the recommended way of using Mui Link with NextJs Link.
Your environment 🌎
`npx @mui/envinfo`
.. ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/nextjs-with-typescript/src/Link.tsx and compare it with the Stack Overflow approach linked in the issue. Check the current MUI and Next.js integration guidance before deciding which pattern should be recommended. Done means the maintained example or relevant documentation clearly presents the agreed integration approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, react
- Domain
- documentation, frontend
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100