From 4902e9ec4fbdc9615d51531ff475348f13c76538 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 24 Oct 2024 13:47:13 +0300 Subject: [PATCH] fix(lde): errors on page re-render --- components/MDX/MDX.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/MDX/MDX.tsx b/components/MDX/MDX.tsx index 32bdb94f9783..c3ead83b61b3 100644 --- a/components/MDX/MDX.tsx +++ b/components/MDX/MDX.tsx @@ -1,7 +1,7 @@ import { MDXProvider as CoreMDXProvider } from '@mdx-js/react'; import mermaid from 'mermaid'; import Link from 'next/link'; -import React, { useLayoutEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { TwitterDMButton, TwitterFollowButton, @@ -97,7 +97,7 @@ function MermaidDiagram({ graph }: MermaidDiagramProps) { /** * @description Renders the Mermaid diagram. */ - useLayoutEffect(() => { + useEffect(() => { if (!graph) { return; }