Help rendering markdown gotten from server using createResource

GitHub
learn-anything/src/routes/[user]/[topic].tsx at main · learn-anythi...
Organize world's knowledge, explore connections and curate learning paths - learn-anything/src/routes/[user]/[topic].tsx at main · learn-anything/learn-anything
8 Replies
nikivi
nikiviOP2y ago
const [content] = createResource(async () => {
const res = await fetch("http://127.0.0.1:3000/users/1/topics")
const jsonResponse = await res.json()
const content = jsonResponse[0].content
return content
})
const [content] = createResource(async () => {
const res = await fetch("http://127.0.0.1:3000/users/1/topics")
const jsonResponse = await res.json()
const content = jsonResponse[0].content
return content
})
nikivi
nikiviOP2y ago
this resource returns a markdown string like this
nikivi
nikiviOP2y ago
GitHub
GitHub - andi23rosca/solid-markdown: Render Markdown as Solid compo...
Render Markdown as Solid components. Contribute to andi23rosca/solid-markdown development by creating an account on GitHub.
nikivi
nikiviOP2y ago
I thought I could somehow give this string to solid-markdown and it would render it out in jsx
nikivi
nikiviOP2y ago
nikivi
nikiviOP2y ago
i get hydration mismatch if i try do this
nikivi
nikiviOP2y ago
nikivi
nikiviOP2y ago
was trying to do this ok ssr: false fixes it
Want results from more Discord servers?
Add your server