mui / mui/material-ui

[link] What's the recommended way of using MUI Link with Next.js Link?

Open
#30,858 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

docs nextjs scope: link
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.