React Markdown Example with Vite
A React and Vite app that renders a Markdown blog, component syntax examples, and a live editor with Comark.
App.tsx
import { Comark } from '@comark/react'
import Alert from './components/Alert'
const markdown = `
# Hello *World*
::alert{type="info"}
This is an alert!
::
`
export default function App() {
return <Comark components={{ Alert }}>{markdown}</Comark>
}
This example renders a Markdown blog, component syntax examples, and a live editor in React with Vite. Pass a Markdown string to <Markdown> from @comark/react to parse and render in one step, or parse ahead of time with parseMarkdown() and pass the document to <MarkdownDocument>.