From eb728396a5483eaad40f81f1237f7b8f92d4f359 Mon Sep 17 00:00:00 2001 From: John Otander Date: Fri, 12 Apr 2019 00:42:27 -0600 Subject: [PATCH] Improve missing props for mdxType --- packages/react/src/create-element.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react/src/create-element.js b/packages/react/src/create-element.js index 19c437079..6df03d634 100644 --- a/packages/react/src/create-element.js +++ b/packages/react/src/create-element.js @@ -28,10 +28,11 @@ const MDXCreateElement = ({ } MDXCreateElement.displayName = 'MDXCreateElement' -export default function(type, props = {}) { +export default function(type, props) { const args = arguments + const mdxType = props && props.mdxType - if (typeof type === 'string' || props.mdxType) { + if (typeof type === 'string' || mdxType) { const argsLength = args.length const createElementArgArray = new Array(argsLength) @@ -44,7 +45,7 @@ export default function(type, props = {}) { } } newProps.originalType = type - newProps[TYPE_PROP_NAME] = typeof type === 'string' ? type : props.mdxType + newProps[TYPE_PROP_NAME] = typeof type === 'string' ? type : mdxType createElementArgArray[1] = newProps