vocs icon indicating copy to clipboard operation
vocs copied to clipboard

Link is not exposed in vocs/components

Open 0xpolarzero opened this issue 11 months ago • 2 comments

Description

vocs/app/components/Link.js is not exported from vocs/components, which makes it difficult to use links in custom tsx components, if we want them to be styled the same as in mdx.

It is also the case for a few other components.

Fix

I tried patching Vocs to export it from vocs/components, but it's generating an error:

On the page:

Unexpected Application Error!
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'virtual:'

In the console:

Uncaught (in promise) SyntaxError: import not found: Link

I'm not sure what I'm doing wrong here, since I could not really relate to the instances of this error I could find online.

Edit

Found out it's pretty easy to replicate, so I'm not sure if it should be exported (also apologies if it's intentional actually).

const Link = ({ href, children }: { href: string; children: ReactNode }) => (
  <a
    href={href}
    target="_blank"
    rel="noopener noreferrer"
    className="vocs_Link_accent_underlined"
  >
    {children}
  </a>
);

0xpolarzero avatar Mar 19 '24 08:03 0xpolarzero