From 71eaccec3c007c09385d0440a2caa6651d1cc78c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 7 Sep 2022 22:14:23 +0100 Subject: [PATCH] [Beta] Fix code diagram layout --- beta/src/components/MDX/CodeDiagram.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beta/src/components/MDX/CodeDiagram.tsx b/beta/src/components/MDX/CodeDiagram.tsx index 26a44333..5c7bc64e 100644 --- a/beta/src/components/MDX/CodeDiagram.tsx +++ b/beta/src/components/MDX/CodeDiagram.tsx @@ -12,7 +12,7 @@ interface CodeDiagramProps { export function CodeDiagram({children, flip = false}: CodeDiagramProps) { const illustration = React.Children.toArray(children).filter((child: any) => { - return child.type?.mdxName === 'img'; + return child.type === 'img'; }); const content = React.Children.toArray(children).map((child: any) => { if (child.type?.mdxName === 'pre') { @@ -23,7 +23,7 @@ export function CodeDiagram({children, flip = false}: CodeDiagramProps) { noMarkers={true} /> ); - } else if (child.type?.mdxName === 'img') { + } else if (child.type === 'img') { return null; } else { return child;