Skip to content

Commit

Permalink
fix: await dynamic css import #2339
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-mihok committed Jun 4, 2024
1 parent b4c6ad4 commit 528d7e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const highlightSyntax = async (str: S, language: S, codeElementId: S) => {

return highlightedCode
}
const importMd = async () => await import('./markdown.css')


export const Markdown = ({ source, compact = true }: { source: S, compact?: B }) => {
const
Expand Down Expand Up @@ -118,7 +120,7 @@ export const Markdown = ({ source, compact = true }: { source: S, compact?: B })
return false
}
}
React.useEffect(() => { import('./markdown.css') }, [])
React.useEffect(() => void importMd(), [])
return <div onClick={onClick} className={`wave-markdown ${compact ? '' : 'wave-prose'}`} dangerouslySetInnerHTML={{ __html: html }} />
}

Expand Down

0 comments on commit 528d7e0

Please sign in to comment.