Skip to content

Commit

Permalink
fix(docs): use async API required by Mermaid v10 (#1579)
Browse files Browse the repository at this point in the history
Docusaurus v3 broke Mermaid in the playground due to an API change.
  • Loading branch information
shadaj authored Nov 21, 2024
1 parent 8e1aed9 commit 0c104c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/src/pages/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import styles from "./playground.module.css";
function MermaidGraph({ id, source }) {
const [svg, setSvg] = useState({ __html: 'Loading Mermaid graph...' });
useEffect(() => {
mermaid.render(id, source, svg => {
mermaid.render(id, source).then(({ svg }) => {
setSvg({
__html: svg,
});
Expand Down

0 comments on commit 0c104c5

Please sign in to comment.