0

I'm a deno/fresh newbie and really appreciate the help.

I'm importing ReactMarkup per the docs like this:

import ReactMarkdown from "https://esm.sh/react-markdown@7";

But it's unclear how to use it in the fresh/preact world. Naively I've tried the below, but that generates this error: TypeError: Cannot convert a Symbol value to a string...at E (https://esm.sh/v102/preact-render-to-string@5.2.4/X-ZS8q/deno/preact-render-to-string.js:12:1829).

<ReactMarkdown>
  ### hey there
</ReactMarkdown>
jps
  • 20,041
  • 15
  • 75
  • 79
TimDog
  • 8,758
  • 5
  • 41
  • 50
  • 1
    Aside: Although [the docs do show using it that way](https://github.com/remarkjs/react-markdown/tree/e63707f57cdc841f66c130ae6aeb60878e24e212#use), I'd never use a bare string literal in the JSX because of some potential syntax conflicts — I'd opt to use a JS string `const md = "### hey there"; const elm = ;` – jsejcksn Jan 15 '23 at 20:53
  • 1
    If you just want markdown rendering, I highly recommend https://deno.land/x/gfm instead. It is maintained by the deno core team and uses marked behind the scenes iirc. – IndevSmiles Jan 21 '23 at 22:30

0 Answers0