React Markdown Example with Vite
A React and Vite app that renders a Markdown blog, a syntax showcase, and a live editor with Comark and a custom alert component.
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 shows the quickest way to use Comark with React - use the Markdown component and pass it markdown content. The component handles parsing and rendering automatically.