Is it possible to disable auto withPrefix at Link component by manual
See original GitHub issueIs it possible to disable auto withPrefix at Link component by manual?
just like this code
<Link to={'link'} disablePrefix={true}>link</Link>
why need this feature?
I use gatsby-plugin-mdx
, and need to rewrap a
component to Link
with custom style. When building with the prefix path, the link in mdx is broken.
The demo repo
gatsby new testgatsbylink suziwen/testgatsbylink
cd testgatsbylink
gatsby build --prefix-paths
gatsby serve --prefix-paths
goto http://localhost:9000/testlink
you will see test
link is broken. The href
value becomes http://localhost:9000/testlink/testlink/link
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
react-router: How to disable a <Link>, if its active?
The How to disable HTML links answer attached suggested using both disabled and pointer-events: none for maximum browser-support.
Read more >Gatsby Link API
Gatsby lets you set the path prefix for your site. After doing so, Gatsby's <Link> component will automatically handle constructing the correct URL...
Read more >gcc(1) - Linux manual page - man7.org
When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The "overall options" allow you to stop this process at an...
Read more >D-Link DIR-866L User Manual
D-Link DIR-866L User Manual. Section 2 - Installation. 1. Turn off and unplug the power to your DSL or cable modem. This is...
Read more >Using the Gatsby Link Component to Navigate Between Pages
How to navigate between pages of your Gatsby website using the Link component, which makes it easy to style when the page is...
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 Free
Top 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
The Link’s
to
value is from mdx, which is alreadywithPrefix
. If I want to rewrapa
component toLink
with custom style, andLink
component doesn’t have the option to disablewithPrefix
, I need manually remove the prefix path ofto
value.Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m
HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!Thanks again for being part of the Gatsby community! 💪💜