Skip to content

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

@danielcrisp

Description

@danielcrisp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunconfirmedNeeds triage.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions