Conflict with NextJS Link Component as Prop
See original GitHub issueAs of next@9
nextjs Link also accepts as
prop for dynamic routing so it breaks dynamic routed links, I am happy to submit PR fix for chakra-ui
but will it be possible for chakra-ui’s Link
component as
prop to be renamed to something else?
Reference
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Conflict between two React when I'm using component from ...
I'm currently building an external library to store all my common components, but when i'm using a NextJs component I got this error:....
Read more >incompatible-href-as - Next.js
The as value is incompatible when the path doesn't provide only the expected parameters for the dynamic route.
Read more >Introduction to Next.js Link component with examples | refine
The Next.js Link component requires a single mandatory prop: href . href specifies the path or URL to navigate to. This could be...
Read more >Dealing with links in Next.js - LogRocket Blog
My first technique is wrapping the Link component. Every routing library has a similar component; it is used instead of the <a> tag....
Read more >Advanced Linking with the Next-Link - Topcoder
The default behavior of the Link component is to push a new URL into the history stack of the props. You can use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @harshzalavadiya,
How about you try this
Since nextjs link is a default export, you can rename it to
NextLink
so there’s no conflict. Changing Chakra’s Link component name will cause some breaking change.Hey - Heres a TS example 👍
Definition: https://github.com/chakra-ui/chakra-ui/blob/develop/examples/nextjs-typescript/components/NextChakraLink.tsx
Usage: https://github.com/chakra-ui/chakra-ui/blob/develop/examples/nextjs-typescript/pages/properties/index.tsx#L12
Broken links - see https://github.com/chakra-ui/chakra-ui/issues/132#issuecomment-821944201