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

Link component doesn't work with Mantine polymorphic Button #1736

Closed
3 tasks done
danielcrisp opened this issue Feb 21, 2025 · 1 comment
Closed
3 tasks done

Link component doesn't work with Mantine polymorphic Button #1736

danielcrisp opened this issue Feb 21, 2025 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@danielcrisp
Copy link

danielcrisp commented Feb 21, 2025

Description

I'm trying to render the next-intl Link component as a Mantine Button as you can do with a standard next/link Link component, however I get the following error:

Only plain objects can be passed to Client Components from Server Components. Classes or other objects with methods are not supported.

It would be great if Link worked as a drop-in replacement for next/link. I don't see anything in the docs suggesting that it shouldn't just work.

Verifications

Mandatory reproduction URL

https://mantine.dev/guides/polymorphic/#polymorphic-components-as-nextjs-link

Reproduction description

Try to use next-intl's Link component with Mantine's button (as you can with the off-the-shelf next/link Link component)

import { Link } from '@/i18n/routing';
import { Button } from '@mantine/core';

function Demo() {
  return (
    <Button component={Link} href="/hello">
      Next link button
    </Button>
  );
}

Based on:
https://mantine.dev/guides/polymorphic/#polymorphic-components-as-nextjs-link

Expected behaviour

The Link component should just work as it is only a wrapper for next/link Link, or the docs should state why it doesn't work.

@danielcrisp danielcrisp added bug Something isn't working unconfirmed Needs triage. labels Feb 21, 2025
@amannn
Copy link
Owner

amannn commented Feb 24, 2025

Thanks for the question, this is a duplicate of #1271

@amannn amannn closed this as completed Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants