-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
It would be great to have async components, in case a component is async the render function would return a promise that resolves when all components resolve
import { codeToTokens } from 'shiki'
export async function CodeSnippet({ code, lang, theme }) {
const renderer = getSVGRenderer({
fontFamily: 'monospace',
fontSize: 14,
bg: '#282c34',
})
const { tokens } = await codeToTokens(code, {
lang,
theme,
})
const svg = renderer.renderToSVG(tokens)
return svg
}Metadata
Metadata
Assignees
Labels
No labels