-
-
Notifications
You must be signed in to change notification settings - Fork 308
Description
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
- I've verified that the problem I'm experiencing isn't covered in the docs.
- I've searched for similar, existing issues on GitHub and Stack Overflow.
- I've compared my app to a working example to look for differences.
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.