56 likes
·
12.1K reads
5 comments
·May 5, 2022
May 5, 2022
Hey thank you for this .. very helpful. I am having trouble with the Link.tsx file though.
…interestingly I have followed your instructions in the past with no issue. This time round something has changed I am am not certain what.
interface NextLinkComposedProps
Interface 'NextLinkComposedProps' cannot simultaneously extend types 'Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">' and 'Omit<InternalLinkProps, "href" | "as">'.
Named property 'onClick' of types 'Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">' and 'Omit<InternalLinkProps, "href" | "as">' are not identical.ts(2320)
1
·
·3 replies
·May 9, 2022
May 9, 2022
Hi,
I was able to work past this by omitting the events with on${string}
:
interface NextLinkComposedProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
"href" | `on${string}`
>,
Omit<NextLinkProps, "href" | "as"> {
to: NextLinkProps["href"];
linkAs?: NextLinkProps["as"];
href?: NextLinkProps["href"];
}
·
·May 9, 2022
May 9, 2022
Cool, thanks for the tip.. I will give your suggestion a try.
·
Author
·Sep 25, 2022
Hey Andrew Jackson! Are you still having this problem? Did the workaround above help?
I have not been able to recreate your issue. What version of React / Next / Material UI are you using?
·
·Jan 4, 2023
Jan 4, 2023
It is awesom and very helpful
·