diff --git a/packages/mdx/mdx-hast-to-jsx.js b/packages/mdx/mdx-hast-to-jsx.js
index <HASH>..<HASH> 100644
--- a/packages/mdx/mdx-hast-to-jsx.js
+++ b/packages/mdx/mdx-hast-to-jsx.js
@@ -43,14 +43,15 @@ function toJSX(node, parentNode = {}) {
 
   if (node.type === 'element') {
     let props = ''
-    if (Object.keys(node.properties).length > 0) {
-      props = JSON.stringify(node.properties)
-    }
-    
+
     if (Array.isArray(node.properties.className)) {
       node.properties.className = node.properties.className.join(' ');
     }
 
+    if (Object.keys(node.properties).length > 0) {
+      props = JSON.stringify(node.properties)
+    }
+    
     return `<MDXTag name="${node.tagName}" components={components}${
       parentNode.tagName ? ` parentName="${parentNode.tagName}"` : ''
     }${props ? ` props={${props}}` : ''}>${children}</MDXTag>`
Fix my earlier PR 🤦‍♂️ (#<I>)