Skip to content

Commit

Permalink
fix mermaid usage
Browse files Browse the repository at this point in the history
  • Loading branch information
eai04191 committed Nov 21, 2023
1 parent 9c452f9 commit f254d75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pages/scenes/diagram.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export function Page({
const reactZoomPanPinchRef = useRef<ReactZoomPanPinchRef>(null);

useEffect(() => {
mermaid.mermaidAPI.render("mermaid", mermaidSource, (svg) => {
(async () => {
const { svg } = await mermaid.render("mermaid", mermaidSource);
setMermaidResult(svg);
});
})();
}, [mermaidSource]);

useEffect(() => {
Expand Down

0 comments on commit f254d75

Please sign in to comment.