Skip to content

Commit

Permalink
maaaaybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Donham committed Jun 24, 2022
1 parent ddb4289 commit 4c84e20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/blocks/mermaid-block/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export default function (props: FileBlockProps) {
const [rendered, setRendered] = React.useState("");

React.useEffect(() => {
const rendered = mermaid.mermaidAPI.render("id", content);
setRendered(rendered);
mermaid.mermaidAPI.render("id", content, (rendered) =>
setRendered(rendered)
);
}, [content]);

return <div id="mermaid" dangerouslySetInnerHTML={{ __html: rendered }} />;
Expand Down

0 comments on commit 4c84e20

Please sign in to comment.